Skip to content

Commit

Permalink
Merge pull request #810 from pimcore/Set-php-8.3-as-min
Browse files Browse the repository at this point in the history
Set php 8.3 as min
  • Loading branch information
herbertroth authored Jan 15, 2025
2 parents ce819cf + 34ac185 commit 2013cc6
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 30 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
"prefer-stable": true,
"minimum-stability": "dev",
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"php": "~8.3.0 || ~8.4.0",
"cbschuld/browser.php": "^1.9.6",
"endroid/qr-code": "^4 || ^5.1",
"phpoffice/phpspreadsheet": "^2.2 || ^3.3",
"pimcore/pimcore": "^11.5.0",
"pimcore/pimcore": "^12.x-dev",
"symfony/webpack-encore-bundle": "^1.17 || ^2.0"
},
"require-dev": {
"codeception/codeception": "^5.0.11",
"codeception/module-asserts": "^2.0.1",
"codeception/module-symfony": "^3.1.1",
"codeception/phpunit-wrapper": "^9",
"phpstan/phpstan": "1.10.30",
"phpstan/phpstan-symfony": "^1.3.2",
"phpstan/phpstan": "1.12.15",
"phpstan/phpstan-symfony": "^1.3.5",
"phpunit/phpunit": "^9.3"
},
"autoload": {
Expand Down
6 changes: 5 additions & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
parameters:
ignoreErrors:
ignoreErrors:
-
message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(mixed\\)\\: bool\\)\\|null, 'intval' given\\.$#"
count: 1
path: src/Controller/Admin/DataObject/ClassificationstoreController.php
7 changes: 5 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
parameters:
level: 6
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
-
identifier: missingType.iterableValue
-
identifier: missingType.generics
paths:
- src
bootstrapFiles:
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Admin/Asset/AssetHelperController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function getMyOwnGridColumnConfigs(int $userId, string $classId, string $
return $configData;
}

public function getSharedGridColumnConfigs(User $user, string $classId, string $searchType = null): array
public function getSharedGridColumnConfigs(User $user, string $classId, ?string $searchType = null): array
{
$db = Db::get();

Expand Down Expand Up @@ -273,7 +273,7 @@ public function doGetGridColumnConfig(Request $request, bool $isDelete = false):
];
}

protected function getFieldGridConfig(array $field, string $language = '', string $keyPrefix = null): ?array
protected function getFieldGridConfig(array $field, string $language = '', ?string $keyPrefix = null): ?array
{
$defaulMetadataFields = ['copyright', 'alt', 'title'];
$predefined = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function loadObjectDataAction(Request $request): JsonResponse
return $this->adminJson($result);
}

public function getMyOwnGridColumnConfigs(int $userId, string $classId, string $searchType = null): array
public function getMyOwnGridColumnConfigs(int $userId, string $classId, ?string $searchType = null): array
{
$db = Db::get();
$configListingConditionParts = [];
Expand Down Expand Up @@ -103,7 +103,7 @@ public function getMyOwnGridColumnConfigs(int $userId, string $classId, string $
return $configData;
}

public function getSharedGridColumnConfigs(User $user, string $classId, string $searchType = null): array
public function getSharedGridColumnConfigs(User $user, string $classId, ?string $searchType = null): array
{
$configListing = [];

Expand Down Expand Up @@ -612,7 +612,7 @@ public function getDefaultGridFields(bool $noSystemColumns, ?DataObject\ClassDef
/**
* @param DataObject\ClassDefinition\Data[] $brickFields
*/
protected function appendBrickFields(DataObject\ClassDefinition\Data $field, array $brickFields, array &$availableFields, string $gridType, int &$count, string $brickType, DataObject\ClassDefinition $class, int $objectId, array $context = null): void
protected function appendBrickFields(DataObject\ClassDefinition\Data $field, array $brickFields, array &$availableFields, string $gridType, int &$count, string $brickType, DataObject\ClassDefinition $class, int $objectId, ?array $context = null): void
{
if (!empty($brickFields)) {
foreach ($brickFields as $bf) {
Expand Down Expand Up @@ -1059,7 +1059,7 @@ protected function updateGridConfigFavourites(?GridConfig $gridConfig, array $me
}
}

protected function getFieldGridConfig(DataObject\ClassDefinition\Data $field, string $gridType, string $position, bool $force = false, string $keyPrefix = null, DataObject\ClassDefinition $class = null, int $objectId = null): ?array
protected function getFieldGridConfig(DataObject\ClassDefinition\Data $field, string $gridType, string $position, bool $force = false, ?string $keyPrefix = null, ?DataObject\ClassDefinition $class = null, ?int $objectId = null): ?array
{
$key = $keyPrefix . $field->getName();
$config = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Admin/Document/DocumentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ public function languageTreeRootAction(Request $request): JsonResponse
]);
}

private function getTranslationTreeNodeConfig(Document $document, array $languages, array $translations = null): array
private function getTranslationTreeNodeConfig(Document $document, array $languages, ?array $translations = null): array
{
$service = new Document\Service();

Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Admin/EmailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function showEmailLogAction(Request $request, ?Profiler $profiler): JsonR
}
}

protected function enhanceLoggingData(array &$data, array &$fullEntry = null): void
protected function enhanceLoggingData(array &$data, ?array &$fullEntry = null): void
{
if (!empty($data['objectClass'])) {
$class = '\\' . ltrim($data['objectClass'], '\\');
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Traits/AdminStyleTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trait AdminStyleTrait
/**
* @throws \Exception
*/
protected function addAdminStyle(ElementInterface $element, int $context = null, array &$data = []): void
protected function addAdminStyle(ElementInterface $element, ?int $context = null, array &$data = []): void
{
$event = new ElementAdminStyleEvent($element, new AdminStyle($element), $context);
\Pimcore::getEventDispatcher()->dispatch($event, AdminEvents::RESOLVE_ELEMENT_ADMIN_STYLE);
Expand Down
2 changes: 1 addition & 1 deletion src/DataObject/GridColumnConfig/Value/DefaultValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function setLocaleService(LocaleServiceInterface $localeService): void
/**
* @throws \Exception
*/
private function getValueForObject(Concrete $object, string $key, string $brickType = null, string $brickKey = null): \stdClass
private function getValueForObject(Concrete $object, string $key, ?string $brickType = null, ?string $brickKey = null): \stdClass
{
if (!$key) {
throw new \Exception('Empty key');
Expand Down
2 changes: 1 addition & 1 deletion src/Event/ElementAdminStyleEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ElementAdminStyleEvent extends Event
/**
* ElementAdminStyleEvent constructor.
*/
public function __construct(ElementInterface $element, AdminStyle $adminStyle, int $context = null)
public function __construct(ElementInterface $element, AdminStyle $adminStyle, ?int $context = null)
{
$this->element = $element;
$this->adminStyle = $adminStyle;
Expand Down
4 changes: 2 additions & 2 deletions src/GDPR/DataProvider/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Assets extends Elements implements DataProviderInterface

protected ?array $config = [];

public function __construct(array $config = null)
public function __construct(?array $config = null)
{
$this->config = $config;
}
Expand Down Expand Up @@ -94,7 +94,7 @@ public function doExportData(Asset $asset): Response
/**
* @throws Exception
*/
public function searchData(int $id, string $firstname, string $lastname, string $email, int $start, int $limit, string $sort = null): array
public function searchData(int $id, string $firstname, string $lastname, string $email, int $start, int $limit, ?string $sort = null): array
{
if (empty($id) && empty($firstname) && empty($lastname) && empty($email)) {
return ['data' => [], 'success' => true, 'total' => 0];
Expand Down
2 changes: 1 addition & 1 deletion src/GDPR/DataProvider/DataObjects.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected function fillIds(ElementInterface $element): void
}
}

public function searchData(int $id, string $firstname, string $lastname, string $email, int $start, int $limit, string $sort = null): array
public function searchData(int $id, string $firstname, string $lastname, string $email, int $start, int $limit, ?string $sort = null): array
{
if (empty($id) && empty($firstname) && empty($lastname) && empty($email)) {
return ['data' => [], 'success' => true, 'total' => 0];
Expand Down
2 changes: 1 addition & 1 deletion src/GDPR/DataProvider/PimcoreUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getSortPriority(): int
return 30;
}

public function searchData(int $id, string $firstname, string $lastname, string $email, int $start, int $limit, string $sort = null): array
public function searchData(int $id, string $firstname, string $lastname, string $email, int $start, int $limit, ?string $sort = null): array
{
if (empty($id) && empty($firstname) && empty($lastname) && empty($email)) {
return ['data' => [], 'success' => true, 'total' => 0];
Expand Down
2 changes: 1 addition & 1 deletion src/Helper/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function getDashboard(string $key = 'welcome'): array
return $dashboard ? $dashboard : ['positions' => [[], []]];
}

public function saveDashboard(string $key, array $configuration = null): void
public function saveDashboard(string $key, ?array $configuration = null): void
{
$this->loadFile();

Expand Down
2 changes: 1 addition & 1 deletion src/Model/GridConfigFavourite.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class GridConfigFavourite extends AbstractModel
*/
protected string $type;

public static function getByOwnerAndClassAndObjectId(int $ownerId, string $classId, int $objectId = null, ?string $searchType = ''): ?GridConfigFavourite
public static function getByOwnerAndClassAndObjectId(int $ownerId, string $classId, ?int $objectId = null, ?string $searchType = ''): ?GridConfigFavourite
{
try {
$favourite = new self();
Expand Down
2 changes: 1 addition & 1 deletion src/Model/GridConfigFavourite/Dao.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Dao extends Model\Dao\AbstractDao
/**
* @throws Model\Exception\NotFoundException
*/
public function getByOwnerAndClassAndObjectId(int $ownerId, string $classId, int $objectId = null, string $searchType = null): void
public function getByOwnerAndClassAndObjectId(int $ownerId, string $classId, ?int $objectId = null, ?string $searchType = null): void
{
$query = 'SELECT * FROM gridconfig_favourites WHERE ownerId = ? AND classId = ? AND searchType = ?';
$params = [$ownerId, $classId, $searchType];
Expand Down
2 changes: 1 addition & 1 deletion src/Perspective/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public static function getStandardPerspective(): array
];
}

public static function getRuntimePerspective(User $currentUser = null): mixed
public static function getRuntimePerspective(?User $currentUser = null): mixed
{
if (null === $currentUser) {
$currentUser = Tool\Admin::getCurrentUser();
Expand Down
2 changes: 1 addition & 1 deletion src/Service/GridData/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
class Asset extends Element
{
public static function getData(Model\Asset $asset, array $fields = null, string $requestedLanguage = null, array $params = []): array
public static function getData(Model\Asset $asset, ?array $fields = null, ?string $requestedLanguage = null, array $params = []): array
{
$data = self::gridElementData($asset);
$loader = null;
Expand Down
4 changes: 2 additions & 2 deletions src/Service/GridData/DataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DataObject extends Element
/**
* Language only user for classification store !!!
*/
public static function getData(AbstractObject $object, array $fields = null, string $requestedLanguage = null, array $params = []): array
public static function getData(AbstractObject $object, ?array $fields = null, ?string $requestedLanguage = null, array $params = []): array
{
$data = self::gridElementData($object);
$csvMode = $params['csvMode'] ?? false;
Expand Down Expand Up @@ -238,7 +238,7 @@ public static function getHelperDefinitions(): array
*
* @return \stdClass value and objectid where the value comes from
*/
private static function getValueForObject(Concrete $object, string $key, string $brickType = null, string $brickKey = null, ClassDefinition\Data $fieldDefinition = null, array $context = [], array $brickDescriptor = null, string $requestedLanguage = null): \stdClass
private static function getValueForObject(Concrete $object, string $key, ?string $brickType = null, ?string $brickKey = null, ?ClassDefinition\Data $fieldDefinition = null, array $context = [], ?array $brickDescriptor = null, ?string $requestedLanguage = null): \stdClass
{
$getter = 'get' . ucfirst($key);
$value = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Translation/AdminUserTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private function getUserLocale(): ?string
return null;
}

public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string
public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string
{
$domain = $domain ?? 'admin';
$locale = $locale ?? $this->getUserLocale();
Expand Down

0 comments on commit 2013cc6

Please sign in to comment.