From f419ce9087dbc9d0576018cce76aaebd70dc4876 Mon Sep 17 00:00:00 2001 From: Alex Zamponi <562324+alexz707@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:02:32 +0100 Subject: [PATCH 1/6] remove php version --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index c99d6102..4059baf6 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,6 @@ "prefer-stable": true, "minimum-stability": "dev", "require": { - "php": "~8.2.0 || ~8.3.0 ", "pimcore/pimcore": "^12.x-dev", "pimcore/static-resolver-bundle": "^1.4.0 || ^2.0", "pimcore/opensearch-client": "^1.1", From c71ff431476be81ff3c2279264888cdad9908d08 Mon Sep 17 00:00:00 2001 From: Alex Zamponi <562324+alexz707@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:04:41 +0100 Subject: [PATCH 2/6] change to latest php versions --- .github/workflows/open-search-codeception.yaml | 6 +++--- .github/workflows/static-analysis.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/open-search-codeception.yaml b/.github/workflows/open-search-codeception.yaml index 66a796c3..5971d976 100644 --- a/.github/workflows/open-search-codeception.yaml +++ b/.github/workflows/open-search-codeception.yaml @@ -30,9 +30,9 @@ jobs: strategy: matrix: include: - - { php-version: "8.2", dependencies: "lowest", pimcore_version: "", experimental: false, search_engine: "openSearch" } - - { php-version: "8.3", dependencies: "highest", pimcore_version: "", experimental: false, search_engine: "openSearch"} - - { php-version: "8.3", dependencies: "highest", pimcore_version: "11.x-dev as 11.99.9", experimental: true, search_engine: "openSearch"} + - { php-version: "8.3", dependencies: "lowest", pimcore_version: "", experimental: false, search_engine: "openSearch" } + - { php-version: "8.4", dependencies: "highest", pimcore_version: "", experimental: false, search_engine: "openSearch"} + - { php-version: "8.4", dependencies: "highest", pimcore_version: "12.x-dev as 12.99.9", experimental: true, search_engine: "openSearch"} services: mariadb: diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index 64949c92..6d71e718 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -24,9 +24,9 @@ jobs: strategy: matrix: include: - - { php-version: "8.2", dependencies: "lowest", experimental: false } - - { php-version: "8.3", dependencies: "highest", experimental: false } - - { php-version: "8.3", dependencies: "highest", pimcore_version: "11.x-dev as 11.99.9", experimental: true } + - { php-version: "8.3", dependencies: "lowest", experimental: false } + - { php-version: "8.4", dependencies: "highest", experimental: false } + - { php-version: "8.4", dependencies: "highest", pimcore_version: "12.x-dev as 12.99.9", experimental: true } steps: - name: "Checkout code" uses: "actions/checkout@v2" From 475466211bc40f5e6e8428c10184c175f7bd57c5 Mon Sep 17 00:00:00 2001 From: Alex Zamponi <562324+alexz707@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:18:42 +0100 Subject: [PATCH 3/6] change to latest php versions --- .github/workflows/elastic-search-codeception.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/elastic-search-codeception.yaml b/.github/workflows/elastic-search-codeception.yaml index 4d6ddeb8..7631f610 100644 --- a/.github/workflows/elastic-search-codeception.yaml +++ b/.github/workflows/elastic-search-codeception.yaml @@ -30,7 +30,7 @@ jobs: strategy: matrix: include: - - { php-version: "8.3", dependencies: "highest", pimcore_version: "11.x-dev as 11.99.9", experimental: true, search_engine: "elasticsearch"} + - { php-version: "8.4", dependencies: "highest", pimcore_version: "12.x-dev as 12.99.9", experimental: true, search_engine: "elasticsearch"} services: mariadb: From e622f64b8c7ae28393ae54eadfa8cfdbcdd776f7 Mon Sep 17 00:00:00 2001 From: Alex Zamponi <562324+alexz707@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:01:50 +0100 Subject: [PATCH 4/6] re-add the php version --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 4059baf6..0677aaf2 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ "prefer-stable": true, "minimum-stability": "dev", "require": { + "php": "~8.3.0 || ~8.4.0 ", "pimcore/pimcore": "^12.x-dev", "pimcore/static-resolver-bundle": "^1.4.0 || ^2.0", "pimcore/opensearch-client": "^1.1", From f8c3ef208093914170b3473bf0c63ac6abe4981d Mon Sep 17 00:00:00 2001 From: Alex Zamponi <562324+alexz707@users.noreply.github.com> Date: Wed, 15 Jan 2025 16:15:18 +0100 Subject: [PATCH 5/6] fix deprecations --- src/Command/DeploymentReindexCommand.php | 2 +- src/Command/ReindexItemsCommand.php | 2 +- src/DependencyInjection/Configuration.php | 2 +- .../FieldCategory/SystemField/SystemFieldTrait.php | 2 +- src/Exception/DefaultSearch/ResultWindowTooLargeException.php | 2 +- src/Exception/DefaultSearch/SearchFailedException.php | 2 +- src/Exception/QueryLanguage/ParsingException.php | 2 +- src/Model/DefaultSearch/Aggregation/AggregationList.php | 2 +- src/Model/DefaultSearch/DefaultSearchInterface.php | 2 +- src/Model/DefaultSearch/Query/QueryList.php | 2 +- src/Model/DefaultSearch/Search.php | 2 +- src/Model/DefaultSearch/Sort/FieldSortList.php | 2 +- src/SearchIndexAdapter/DataObject/AdapterInterface.php | 2 +- .../DataObject/FieldDefinitionAdapter/AbstractAdapter.php | 2 +- .../FieldDefinitionAdapter/ClassificationStoreAdapter.php | 2 +- .../FieldDefinitionAdapter/LocalizedFieldsAdapter.php | 2 +- .../DataObject/FieldDefinitionAdapter/ObjectBrickAdapter.php | 2 +- src/SearchIndexAdapter/DefaultSearch/DefaultSearchService.php | 4 ++-- src/SearchIndexAdapter/DefaultSearch/IndexAliasService.php | 2 +- .../FieldNameValidator/LocalizedFieldValidator.php | 2 +- .../DefaultSearch/Search/LocateInTreeService.php | 4 ++-- src/SearchIndexAdapter/IndexAliasServiceInterface.php | 2 +- src/SearchIndexAdapter/SearchIndexServiceInterface.php | 4 ++-- .../Denormalizer/Search/AssetSearchResultDenormalizer.php | 4 ++-- .../Search/DataObjectSearchResultDenormalizer.php | 4 ++-- .../Denormalizer/Search/DocumentSearchResultDenormalizer.php | 4 ++-- src/Service/Serializer/Normalizer/AssetNormalizer.php | 4 ++-- src/Service/Serializer/Normalizer/DataObjectNormalizer.php | 4 ++-- src/Service/Serializer/Normalizer/DocumentNormalizer.php | 4 ++-- 29 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/Command/DeploymentReindexCommand.php b/src/Command/DeploymentReindexCommand.php index 793bbf98..c78dd4e8 100644 --- a/src/Command/DeploymentReindexCommand.php +++ b/src/Command/DeploymentReindexCommand.php @@ -36,7 +36,7 @@ final class DeploymentReindexCommand extends AbstractCommand public function __construct( private readonly EnqueueServiceInterface $enqueueService, private readonly ClassDefinitionReindexServiceInterface $classDefinitionReindexService, - string $name = null + ?string $name = null ) { parent::__construct($name); } diff --git a/src/Command/ReindexItemsCommand.php b/src/Command/ReindexItemsCommand.php index d2d1523e..734957e7 100644 --- a/src/Command/ReindexItemsCommand.php +++ b/src/Command/ReindexItemsCommand.php @@ -33,7 +33,7 @@ final class ReindexItemsCommand extends AbstractCommand public function __construct( private readonly ReindexServiceInterface $reindexService, - string $name = null + ?string $name = null ) { parent::__construct($name); } diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index fc83c3d2..023abf10 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -131,7 +131,7 @@ public function getConfigTreeBuilder(): TreeBuilder return $treeBuilder; } - private function buildVariableNode(string $name, array $defaultValue = [], string $documentation = null): NodeDefinition + private function buildVariableNode(string $name, array $defaultValue = [], ?string $documentation = null): NodeDefinition { $node = new VariableNodeDefinition($name); if ($documentation) { diff --git a/src/Enum/SearchIndex/FieldCategory/SystemField/SystemFieldTrait.php b/src/Enum/SearchIndex/FieldCategory/SystemField/SystemFieldTrait.php index b7bd4f3b..ce7f7026 100644 --- a/src/Enum/SearchIndex/FieldCategory/SystemField/SystemFieldTrait.php +++ b/src/Enum/SearchIndex/FieldCategory/SystemField/SystemFieldTrait.php @@ -20,7 +20,7 @@ trait SystemFieldTrait { - public function getPath(string $subField = null): string + public function getPath(?string $subField = null): string { $path = FieldCategory::SYSTEM_FIELDS->value . '.' . $this->value; diff --git a/src/Exception/DefaultSearch/ResultWindowTooLargeException.php b/src/Exception/DefaultSearch/ResultWindowTooLargeException.php index 47d4cd61..ff64996d 100644 --- a/src/Exception/DefaultSearch/ResultWindowTooLargeException.php +++ b/src/Exception/DefaultSearch/ResultWindowTooLargeException.php @@ -30,7 +30,7 @@ public function __construct( private readonly SearchInformation $searchInformation, mixed $message = '', mixed $code = 0, - Throwable $previous = null + ?Throwable $previous = null ) { parent::__construct($message, $code, $previous); } diff --git a/src/Exception/DefaultSearch/SearchFailedException.php b/src/Exception/DefaultSearch/SearchFailedException.php index 241c35a5..52b1e72a 100644 --- a/src/Exception/DefaultSearch/SearchFailedException.php +++ b/src/Exception/DefaultSearch/SearchFailedException.php @@ -27,7 +27,7 @@ public function __construct( private readonly SearchInformation $searchInformation, mixed $message = '', mixed $code = 0, - Throwable $previous = null + ?Throwable $previous = null ) { parent::__construct($message, $code, $previous); } diff --git a/src/Exception/QueryLanguage/ParsingException.php b/src/Exception/QueryLanguage/ParsingException.php index f7985d9e..966232ce 100644 --- a/src/Exception/QueryLanguage/ParsingException.php +++ b/src/Exception/QueryLanguage/ParsingException.php @@ -28,7 +28,7 @@ public function __construct( private readonly ?Token $token, ?string $message = null, private readonly ?int $position = null, - Exception $previous = null + ?Exception $previous = null ) { $message = $message ?? sprintf('Expected %s, found %s.', $expected, $found); diff --git a/src/Model/DefaultSearch/Aggregation/AggregationList.php b/src/Model/DefaultSearch/Aggregation/AggregationList.php index 0d4e59fd..ae6b63c0 100644 --- a/src/Model/DefaultSearch/Aggregation/AggregationList.php +++ b/src/Model/DefaultSearch/Aggregation/AggregationList.php @@ -24,7 +24,7 @@ public function __construct( ) { } - public function addAggregation(Aggregation $aggregation = null): AggregationList + public function addAggregation(?Aggregation $aggregation = null): AggregationList { if ($aggregation !== null) { $this->aggregations[] = $aggregation; diff --git a/src/Model/DefaultSearch/DefaultSearchInterface.php b/src/Model/DefaultSearch/DefaultSearchInterface.php index f7670f0c..a15337bd 100644 --- a/src/Model/DefaultSearch/DefaultSearchInterface.php +++ b/src/Model/DefaultSearch/DefaultSearchInterface.php @@ -27,7 +27,7 @@ */ interface DefaultSearchInterface extends AdapterSearchInterface { - public function addQuery(QueryInterface $query = null): DefaultSearchInterface; + public function addQuery(?QueryInterface $query = null): DefaultSearchInterface; public function addSort(FieldSort $sort): DefaultSearchInterface; diff --git a/src/Model/DefaultSearch/Query/QueryList.php b/src/Model/DefaultSearch/Query/QueryList.php index f5a7e7f6..bc4e7adf 100644 --- a/src/Model/DefaultSearch/Query/QueryList.php +++ b/src/Model/DefaultSearch/Query/QueryList.php @@ -32,7 +32,7 @@ public function __construct( ) { } - public function addQuery(QueryInterface $query = null): QueryList + public function addQuery(?QueryInterface $query = null): QueryList { if ($query instanceof BoolQuery && !$query->isEmpty()) { if ($this->boolQuery !== null) { diff --git a/src/Model/DefaultSearch/Search.php b/src/Model/DefaultSearch/Search.php index 6091c399..f3cfcb7f 100644 --- a/src/Model/DefaultSearch/Search.php +++ b/src/Model/DefaultSearch/Search.php @@ -74,7 +74,7 @@ public function setSource(bool|array|string|null $source): DefaultSearchInterfac return $this; } - public function addQuery(QueryInterface $query = null): DefaultSearchInterface + public function addQuery(?QueryInterface $query = null): DefaultSearchInterface { $this->queryList->addQuery($query); diff --git a/src/Model/DefaultSearch/Sort/FieldSortList.php b/src/Model/DefaultSearch/Sort/FieldSortList.php index 6265be12..eaddbc85 100644 --- a/src/Model/DefaultSearch/Sort/FieldSortList.php +++ b/src/Model/DefaultSearch/Sort/FieldSortList.php @@ -24,7 +24,7 @@ public function __construct( ) { } - public function addSort(FieldSort $sort = null): FieldSortList + public function addSort(?FieldSort $sort = null): FieldSortList { if ($sort !== null) { $this->sort[] = $sort; diff --git a/src/SearchIndexAdapter/DataObject/AdapterInterface.php b/src/SearchIndexAdapter/DataObject/AdapterInterface.php index f4e06580..8bf71742 100644 --- a/src/SearchIndexAdapter/DataObject/AdapterInterface.php +++ b/src/SearchIndexAdapter/DataObject/AdapterInterface.php @@ -47,6 +47,6 @@ public function getInheritedData( mixed $value, string $key, ?string $language = null, - callable $callback = null + ?callable $callback = null ): array; } diff --git a/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/AbstractAdapter.php b/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/AbstractAdapter.php index b25cb810..e7bd0bb5 100644 --- a/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/AbstractAdapter.php +++ b/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/AbstractAdapter.php @@ -76,7 +76,7 @@ public function getInheritedData( mixed $value, string $key, ?string $language = null, - callable $callback = null + ?callable $callback = null ): array { if (!$this->fieldDefinition->isEmpty($value)) { return []; diff --git a/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/ClassificationStoreAdapter.php b/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/ClassificationStoreAdapter.php index 17010e74..0f84b8ac 100644 --- a/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/ClassificationStoreAdapter.php +++ b/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/ClassificationStoreAdapter.php @@ -117,7 +117,7 @@ public function getInheritedData( mixed $value, string $key, ?string $language = null, - callable $callback = null + ?callable $callback = null ): array { $classificationStore = $this->getClassificationStoreDefinition(); $languages = $this->getValidLanguages($classificationStore); diff --git a/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/LocalizedFieldsAdapter.php b/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/LocalizedFieldsAdapter.php index 825c0df5..48d772c6 100644 --- a/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/LocalizedFieldsAdapter.php +++ b/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/LocalizedFieldsAdapter.php @@ -97,7 +97,7 @@ public function getInheritedData( mixed $value, string $key, ?string $language = null, - callable $callback = null + ?callable $callback = null ): array { $indexData = $this->getIndexData($value); if (empty($indexData)) { diff --git a/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/ObjectBrickAdapter.php b/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/ObjectBrickAdapter.php index e68fad8b..c042fd71 100644 --- a/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/ObjectBrickAdapter.php +++ b/src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/ObjectBrickAdapter.php @@ -97,7 +97,7 @@ public function getInheritedData( mixed $value, string $key, ?string $language = null, - callable $callback = null + ?callable $callback = null ): array { if (!$value instanceof Objectbrick) { return []; diff --git a/src/SearchIndexAdapter/DefaultSearch/DefaultSearchService.php b/src/SearchIndexAdapter/DefaultSearch/DefaultSearchService.php index c1e171b8..0ff883cb 100644 --- a/src/SearchIndexAdapter/DefaultSearch/DefaultSearchService.php +++ b/src/SearchIndexAdapter/DefaultSearch/DefaultSearchService.php @@ -125,7 +125,7 @@ public function reindex(string $indexName, array $mapping): void $this->switchIndexAliasAndCleanup($indexName, $oldIndexName, $newIndexName); } - public function createIndex(string $indexName, array $mappings = null): DefaultSearchService + public function createIndex(string $indexName, ?array $mappings = null): DefaultSearchService { $this->deleteIndex($indexName, true); @@ -161,7 +161,7 @@ public function addAlias(string $aliasName, string $indexName): array return $this->indexAliasService->addAlias($aliasName, $indexName); } - public function existsAlias(string $aliasName, string $indexName = null): bool + public function existsAlias(string $aliasName, ?string $indexName = null): bool { return $this->indexAliasService->existsAlias($aliasName, $indexName); } diff --git a/src/SearchIndexAdapter/DefaultSearch/IndexAliasService.php b/src/SearchIndexAdapter/DefaultSearch/IndexAliasService.php index 0ea7374c..c36723b0 100644 --- a/src/SearchIndexAdapter/DefaultSearch/IndexAliasService.php +++ b/src/SearchIndexAdapter/DefaultSearch/IndexAliasService.php @@ -47,7 +47,7 @@ public function addAlias(string $aliasName, string $indexName): array return $this->client->updateIndexAliases($params); } - public function existsAlias(string $aliasName, string $indexName = null): bool + public function existsAlias(string $aliasName, ?string $indexName = null): bool { return $this->client->existsIndexAlias([ 'name' => $aliasName, diff --git a/src/SearchIndexAdapter/DefaultSearch/QueryLanguage/FieldNameValidator/LocalizedFieldValidator.php b/src/SearchIndexAdapter/DefaultSearch/QueryLanguage/FieldNameValidator/LocalizedFieldValidator.php index 5cb83972..547dc1d5 100644 --- a/src/SearchIndexAdapter/DefaultSearch/QueryLanguage/FieldNameValidator/LocalizedFieldValidator.php +++ b/src/SearchIndexAdapter/DefaultSearch/QueryLanguage/FieldNameValidator/LocalizedFieldValidator.php @@ -32,7 +32,7 @@ public function __construct( private MappingAnalyzerServiceInterface $mappingAnalyzerService, - string $defaultLanguage = null + ?string $defaultLanguage = null ) { $this->defaultLocale = $defaultLanguage ?? Tool::getDefaultLanguage(); } diff --git a/src/SearchIndexAdapter/DefaultSearch/Search/LocateInTreeService.php b/src/SearchIndexAdapter/DefaultSearch/Search/LocateInTreeService.php index f2e604cb..db6c42ca 100644 --- a/src/SearchIndexAdapter/DefaultSearch/Search/LocateInTreeService.php +++ b/src/SearchIndexAdapter/DefaultSearch/Search/LocateInTreeService.php @@ -90,8 +90,8 @@ private function getElementPosition(SearchInterface $search, int $elementId): ?i private function createDefaultSearch( SearchInterface $search, - int $pageSize = null, - SearchResult $searchAfterSearchResult = null + ?int $pageSize = null, + ?SearchResult $searchAfterSearchResult = null ): Search { $pageSize = $pageSize ?? $search->getPageSize(); diff --git a/src/SearchIndexAdapter/IndexAliasServiceInterface.php b/src/SearchIndexAdapter/IndexAliasServiceInterface.php index 71c0466e..fc1e25b1 100644 --- a/src/SearchIndexAdapter/IndexAliasServiceInterface.php +++ b/src/SearchIndexAdapter/IndexAliasServiceInterface.php @@ -23,7 +23,7 @@ interface IndexAliasServiceInterface { public function addAlias(string $aliasName, string $indexName): array; - public function existsAlias(string $aliasName, string $indexName = null): bool; + public function existsAlias(string $aliasName, ?string $indexName = null): bool; public function deleteAlias(string $indexName, string $aliasName): array; diff --git a/src/SearchIndexAdapter/SearchIndexServiceInterface.php b/src/SearchIndexAdapter/SearchIndexServiceInterface.php index 5d07e4cc..f297e1a2 100644 --- a/src/SearchIndexAdapter/SearchIndexServiceInterface.php +++ b/src/SearchIndexAdapter/SearchIndexServiceInterface.php @@ -37,11 +37,11 @@ public function getCurrentIndexVersion(string $indexName): string; */ public function reindex(string $indexName, array $mapping): void; - public function createIndex(string $indexName, array $mappings = null): self; + public function createIndex(string $indexName, ?array $mappings = null): self; public function addAlias(string $aliasName, string $indexName): array; - public function existsAlias(string $aliasName, string $indexName = null): bool; + public function existsAlias(string $aliasName, ?string $indexName = null): bool; public function deleteAlias(string $indexName, string $aliasName): array; diff --git a/src/Service/Serializer/Denormalizer/Search/AssetSearchResultDenormalizer.php b/src/Service/Serializer/Denormalizer/Search/AssetSearchResultDenormalizer.php index 017a4b7a..cf2d212c 100644 --- a/src/Service/Serializer/Denormalizer/Search/AssetSearchResultDenormalizer.php +++ b/src/Service/Serializer/Denormalizer/Search/AssetSearchResultDenormalizer.php @@ -38,7 +38,7 @@ public function __construct( public function denormalize( mixed $data, string $type, - string $format = null, + ?string $format = null, array $context = [] ): AssetSearchResultItem { @@ -80,7 +80,7 @@ public function denormalize( } - public function supportsDenormalization(mixed $data, string $type, string $format = null): bool + public function supportsDenormalization(mixed $data, string $type, ?string $format = null): bool { return is_array($data) && is_subclass_of($type, AssetSearchResultItem::class); } diff --git a/src/Service/Serializer/Denormalizer/Search/DataObjectSearchResultDenormalizer.php b/src/Service/Serializer/Denormalizer/Search/DataObjectSearchResultDenormalizer.php index d4c4efbd..948c537d 100644 --- a/src/Service/Serializer/Denormalizer/Search/DataObjectSearchResultDenormalizer.php +++ b/src/Service/Serializer/Denormalizer/Search/DataObjectSearchResultDenormalizer.php @@ -37,7 +37,7 @@ public function __construct( public function denormalize( mixed $data, string $type, - string $format = null, + ?string $format = null, array $context = [] ): DataObjectSearchResultItem { @@ -92,7 +92,7 @@ public function denormalize( } - public function supportsDenormalization(mixed $data, string $type, string $format = null): bool + public function supportsDenormalization(mixed $data, string $type, ?string $format = null): bool { return is_array($data) && is_subclass_of($type, DataObjectSearchResultItem::class); } diff --git a/src/Service/Serializer/Denormalizer/Search/DocumentSearchResultDenormalizer.php b/src/Service/Serializer/Denormalizer/Search/DocumentSearchResultDenormalizer.php index f9c140f8..4f04b5ac 100644 --- a/src/Service/Serializer/Denormalizer/Search/DocumentSearchResultDenormalizer.php +++ b/src/Service/Serializer/Denormalizer/Search/DocumentSearchResultDenormalizer.php @@ -35,7 +35,7 @@ public function __construct( public function denormalize( mixed $data, string $type, - string $format = null, + ?string $format = null, array $context = [] ): DocumentSearchResultItem { @@ -74,7 +74,7 @@ public function denormalize( ->setHasWorkflowWithPermissions(SystemField::HAS_WORKFLOW_WITH_PERMISSIONS->getData($data)); } - public function supportsDenormalization(mixed $data, string $type, string $format = null): bool + public function supportsDenormalization(mixed $data, string $type, ?string $format = null): bool { return is_array($data) && is_subclass_of($type, DocumentSearchResultItem::class); } diff --git a/src/Service/Serializer/Normalizer/AssetNormalizer.php b/src/Service/Serializer/Normalizer/AssetNormalizer.php index f1b95df6..d7766ea5 100644 --- a/src/Service/Serializer/Normalizer/AssetNormalizer.php +++ b/src/Service/Serializer/Normalizer/AssetNormalizer.php @@ -46,7 +46,7 @@ public function __construct( ) { } - public function normalize(mixed $object, string $format = null, array $context = []): array + public function normalize(mixed $object, ?string $format = null, array $context = []): array { $skipLazyLoadedFields = SerializerContext::SKIP_LAZY_LOADED_FIELDS->containedInContext($context); @@ -63,7 +63,7 @@ public function normalize(mixed $object, string $format = null, array $context = return []; } - public function supportsNormalization(mixed $data, string $format = null): bool + public function supportsNormalization(mixed $data, ?string $format = null): bool { return $data instanceof Asset; } diff --git a/src/Service/Serializer/Normalizer/DataObjectNormalizer.php b/src/Service/Serializer/Normalizer/DataObjectNormalizer.php index 69107898..5a2189b4 100644 --- a/src/Service/Serializer/Normalizer/DataObjectNormalizer.php +++ b/src/Service/Serializer/Normalizer/DataObjectNormalizer.php @@ -52,7 +52,7 @@ public function __construct( * * @throws Exception */ - public function normalize(mixed $object, string $format = null, array $context = []): array + public function normalize(mixed $object, ?string $format = null, array $context = []): array { $skipLazyLoadedFields = SerializerContext::SKIP_LAZY_LOADED_FIELDS->containedInContext($context); @@ -69,7 +69,7 @@ public function normalize(mixed $object, string $format = null, array $context = return []; } - public function supportsNormalization(mixed $data, string $format = null): bool + public function supportsNormalization(mixed $data, ?string $format = null): bool { return $data instanceof AbstractObject; } diff --git a/src/Service/Serializer/Normalizer/DocumentNormalizer.php b/src/Service/Serializer/Normalizer/DocumentNormalizer.php index b2bb46c0..c2fa993a 100644 --- a/src/Service/Serializer/Normalizer/DocumentNormalizer.php +++ b/src/Service/Serializer/Normalizer/DocumentNormalizer.php @@ -42,7 +42,7 @@ public function __construct( ) { } - public function normalize(mixed $object, string $format = null, array $context = []): array + public function normalize(mixed $object, ?string $format = null, array $context = []): array { $skipLazyLoadedFields = SerializerContext::SKIP_LAZY_LOADED_FIELDS->containedInContext($context); @@ -59,7 +59,7 @@ public function normalize(mixed $object, string $format = null, array $context = return []; } - public function supportsNormalization(mixed $data, string $format = null): bool + public function supportsNormalization(mixed $data, ?string $format = null): bool { return $data instanceof Document; } From 89c2dd095420ce31694408ade6a6ff2dc424848e Mon Sep 17 00:00:00 2001 From: Alex Zamponi <562324+alexz707@users.noreply.github.com> Date: Wed, 15 Jan 2025 16:17:53 +0100 Subject: [PATCH 6/6] fix deprecations --- src/DependencyInjection/Configuration.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 023abf10..e27f2c39 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -131,8 +131,11 @@ public function getConfigTreeBuilder(): TreeBuilder return $treeBuilder; } - private function buildVariableNode(string $name, array $defaultValue = [], ?string $documentation = null): NodeDefinition - { + private function buildVariableNode( + string $name, + array $defaultValue = [], + ?string $documentation = null + ): NodeDefinition { $node = new VariableNodeDefinition($name); if ($documentation) { $node->info($documentation);