From 19e1431e8911f151cf4a1431858e78f82d0e68e9 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 19 Nov 2024 16:05:37 +0100 Subject: [PATCH 01/11] [TMP] Required Symfony 6 dev branches of Ibexa packages --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 1a4bec0..8ceee19 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ }, "require": { "php": " >=8.3", - "ibexa/core": "~5.0.x-dev", + "ibexa/core": "dev-ibx-8470-symfony-6 as 5.0.x-dev", "pagerfanta/pagerfanta": "^2.1", "symfony/config": "^5.0", "symfony/dependency-injection": "^5.0", @@ -35,7 +35,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^3.0", "ibexa/code-style": "^1.0", - "ibexa/doctrine-schema": "~5.0.x-dev", + "ibexa/doctrine-schema": "dev-ibx-8470-symfony-6 as 5.0.x-dev", "matthiasnoback/symfony-dependency-injection-test": "^4.3", "phpstan/phpstan": "^1.10", "phpstan/phpstan-phpunit": "^1.3", From daa5a7fc96fd3e3a110dbcd06c0f53d3156d8c51 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 19 Nov 2024 16:10:02 +0100 Subject: [PATCH 02/11] Bumped Symfony packages requirements to ^6.4 --- composer.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 8ceee19..c2e2630 100644 --- a/composer.json +++ b/composer.json @@ -24,13 +24,13 @@ "php": " >=8.3", "ibexa/core": "dev-ibx-8470-symfony-6 as 5.0.x-dev", "pagerfanta/pagerfanta": "^2.1", - "symfony/config": "^5.0", - "symfony/dependency-injection": "^5.0", - "symfony/event-dispatcher": "^5.0", - "symfony/form": "^5.0", - "symfony/http-foundation": "^5.0", - "symfony/http-kernel": "^5.0", - "symfony/serializer": "^5.4" + "symfony/config": "^6.4", + "symfony/dependency-injection": "^6.4", + "symfony/event-dispatcher": "^6.4", + "symfony/form": "^6.4", + "symfony/http-foundation": "^6.4", + "symfony/http-kernel": "^6.4", + "symfony/serializer": "^6.4" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.0", From 5beff6f2a3d6bb6cb57f048577156bb576be66c5 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 19 Nov 2024 16:11:38 +0100 Subject: [PATCH 03/11] [CS] Upgraded Ibexa Code Style to ~2.0.0 --- composer.json | 3 +-- .../EventListener/ContentSuggestionSubscriberTest.php | 2 +- tests/lib/QueryType/SearchQueryTypeTest.php | 2 +- tests/lib/Service/Event/SuggestionServiceTest.php | 6 +++--- .../Provider/NameSortingDefinitionProviderTest.php | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index c2e2630..f6ed0b2 100644 --- a/composer.json +++ b/composer.json @@ -33,8 +33,7 @@ "symfony/serializer": "^6.4" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.0", - "ibexa/code-style": "^1.0", + "ibexa/code-style": "~2.0.0", "ibexa/doctrine-schema": "dev-ibx-8470-symfony-6 as 5.0.x-dev", "matthiasnoback/symfony-dependency-injection-test": "^4.3", "phpstan/phpstan": "^1.10", diff --git a/tests/lib/EventDispatcher/EventListener/ContentSuggestionSubscriberTest.php b/tests/lib/EventDispatcher/EventListener/ContentSuggestionSubscriberTest.php index aa00398..35da31b 100644 --- a/tests/lib/EventDispatcher/EventListener/ContentSuggestionSubscriberTest.php +++ b/tests/lib/EventDispatcher/EventListener/ContentSuggestionSubscriberTest.php @@ -116,7 +116,7 @@ public function testOnContentSuggestionWithException(): void $event = new BuildSuggestionCollectionEvent($query); $this->loggerMock - ->expects($this->once()) + ->expects(self::once()) ->method('error'); $subscriber->onBuildSuggestionCollectionEvent($event); diff --git a/tests/lib/QueryType/SearchQueryTypeTest.php b/tests/lib/QueryType/SearchQueryTypeTest.php index 0353635..e049e75 100644 --- a/tests/lib/QueryType/SearchQueryTypeTest.php +++ b/tests/lib/QueryType/SearchQueryTypeTest.php @@ -62,7 +62,7 @@ public function testGetQuery( ->method('supports') ->willReturnMap($returnMap); - $this->assertEquals($expectedQuery, $this->queryType->getQuery($parameters)); + self::assertEquals($expectedQuery, $this->queryType->getQuery($parameters)); } /** diff --git a/tests/lib/Service/Event/SuggestionServiceTest.php b/tests/lib/Service/Event/SuggestionServiceTest.php index 78ceb7d..02e875c 100644 --- a/tests/lib/Service/Event/SuggestionServiceTest.php +++ b/tests/lib/Service/Event/SuggestionServiceTest.php @@ -57,7 +57,7 @@ static function (Event $event) use (&$callCount, $query, $suggestionCollection): ); $this->innerServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('suggest') ->with($query) ->willReturn($suggestionCollection); @@ -75,12 +75,12 @@ public function testSuggestWithPropagationStop(): void $beforeEvent->stopPropagation(); $this->eventDispatcherMock - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') ->willReturn($beforeEvent); $this->innerServiceMock - ->expects($this->never()) + ->expects(self::never()) ->method('suggest'); $service = new SuggestionService($this->innerServiceMock, $this->eventDispatcherMock); diff --git a/tests/lib/SortingDefinition/Provider/NameSortingDefinitionProviderTest.php b/tests/lib/SortingDefinition/Provider/NameSortingDefinitionProviderTest.php index 47b0433..3b1f19c 100644 --- a/tests/lib/SortingDefinition/Provider/NameSortingDefinitionProviderTest.php +++ b/tests/lib/SortingDefinition/Provider/NameSortingDefinitionProviderTest.php @@ -44,7 +44,7 @@ public function testGetSortingDefinitionsForLSE(): void { $this->setSearchEngine('legacy'); - $this->assertEquals( + self::assertEquals( [ new SortingDefinition( 'name_asc', @@ -71,7 +71,7 @@ public function testGetSortingDefinitionsForNonLSE(): void { $this->setSearchEngine('solr'); - $this->assertEquals( + self::assertEquals( [ new SortingDefinition( 'name_asc', From 6ce5b93bdaaccd7dc40b30ec22d6f982da83f58b Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 19 Nov 2024 16:14:31 +0100 Subject: [PATCH 04/11] [Tests] Fixed incorrect usage of expectException --- tests/lib/Service/Event/SuggestionServiceTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/lib/Service/Event/SuggestionServiceTest.php b/tests/lib/Service/Event/SuggestionServiceTest.php index 02e875c..7d88492 100644 --- a/tests/lib/Service/Event/SuggestionServiceTest.php +++ b/tests/lib/Service/Event/SuggestionServiceTest.php @@ -85,8 +85,8 @@ public function testSuggestWithPropagationStop(): void $service = new SuggestionService($this->innerServiceMock, $this->eventDispatcherMock); - self::expectException(LogicException::class); - self::expectExceptionMessage('The suggestion collection must be set when the propagation is stopped.'); + $this->expectException(LogicException::class); + $this->expectExceptionMessage('The suggestion collection must be set when the propagation is stopped.'); $service->suggest($query); } } From 70af0a127e9410dbc4de8c49659355cded9dd498 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 19 Nov 2024 16:19:56 +0100 Subject: [PATCH 05/11] Upgraded Symfony Forms extension points code --- .../ConfiguredLanguagesChoiceLoader.php | 30 +++++----------- .../ChoiceLoader/ContentTypeChoiceLoader.php | 34 ++++++------------- 2 files changed, 19 insertions(+), 45 deletions(-) diff --git a/src/bundle/Form/ChoiceLoader/ConfiguredLanguagesChoiceLoader.php b/src/bundle/Form/ChoiceLoader/ConfiguredLanguagesChoiceLoader.php index aff0213..98c6683 100644 --- a/src/bundle/Form/ChoiceLoader/ConfiguredLanguagesChoiceLoader.php +++ b/src/bundle/Form/ChoiceLoader/ConfiguredLanguagesChoiceLoader.php @@ -11,20 +11,15 @@ use Ibexa\Contracts\Core\Repository\LanguageService; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; use Symfony\Component\Form\ChoiceList\ArrayChoiceList; +use Symfony\Component\Form\ChoiceList\ChoiceListInterface; use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface; class ConfiguredLanguagesChoiceLoader implements ChoiceLoaderInterface { - /** @var \Ibexa\Contracts\Core\Repository\LanguageService */ - private $languageService; + private LanguageService $languageService; - /** @var \Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface */ - private $configResolver; + private ConfigResolverInterface $configResolver; - /** - * @param \Ibexa\Contracts\Core\Repository\LanguageService $languageService - * @param \Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface $configResolver - */ public function __construct(LanguageService $languageService, ConfigResolverInterface $configResolver) { $this->languageService = $languageService; @@ -32,27 +27,21 @@ public function __construct(LanguageService $languageService, ConfigResolverInte } /** - * {@inheritdoc} + * @return \Ibexa\Contracts\Core\Repository\Values\Content\Language[] */ public function getChoiceList(): array { return $this->getPriorityOrderedLanguages(); } - /** - * {@inheritdoc} - */ - public function loadChoiceList(callable $value = null) + public function loadChoiceList(callable $value = null): ChoiceListInterface { $choices = $this->getChoiceList(); return new ArrayChoiceList($choices, $value); } - /** - * {@inheritdoc} - */ - public function loadChoicesForValues(array $values, callable $value = null) + public function loadChoicesForValues(array $values, callable $value = null): array { // Optimize $values = array_filter($values); @@ -63,10 +52,7 @@ public function loadChoicesForValues(array $values, callable $value = null) return $this->loadChoiceList($value)->getChoicesForValues($values); } - /** - * {@inheritdoc} - */ - public function loadValuesForChoices(array $choices, callable $value = null) + public function loadValuesForChoices(array $choices, callable $value = null): array { // Optimize $choices = array_filter($choices); @@ -78,7 +64,7 @@ public function loadValuesForChoices(array $choices, callable $value = null) } /** - * Sort languages based on siteaccess languages order. + * Sort languages based on SiteAccess languages order. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Language[] */ diff --git a/src/bundle/Form/ChoiceLoader/ContentTypeChoiceLoader.php b/src/bundle/Form/ChoiceLoader/ContentTypeChoiceLoader.php index 2d7e4f9..e14e428 100644 --- a/src/bundle/Form/ChoiceLoader/ContentTypeChoiceLoader.php +++ b/src/bundle/Form/ChoiceLoader/ContentTypeChoiceLoader.php @@ -12,28 +12,25 @@ use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType; use Ibexa\Core\MVC\Symfony\Locale\UserLanguagePreferenceProviderInterface; use Symfony\Component\Form\ChoiceList\ArrayChoiceList; +use Symfony\Component\Form\ChoiceList\ChoiceListInterface; use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface; class ContentTypeChoiceLoader implements ChoiceLoaderInterface { - /** @var \Ibexa\Contracts\Core\Repository\ContentTypeService */ - protected $contentTypeService; + protected ContentTypeService $contentTypeService; - /** @var \Ibexa\Core\MVC\Symfony\Locale\UserLanguagePreferenceProviderInterface */ - private $userLanguagePreferenceProvider; + private UserLanguagePreferenceProviderInterface $userLanguagePreferenceProvider; - /** - * @param \Ibexa\Contracts\Core\Repository\ContentTypeService $contentTypeService - * @param \Ibexa\Core\MVC\Symfony\Locale\UserLanguagePreferenceProviderInterface $userLanguagePreferenceProvider - */ - public function __construct(ContentTypeService $contentTypeService, UserLanguagePreferenceProviderInterface $userLanguagePreferenceProvider) - { + public function __construct( + ContentTypeService $contentTypeService, + UserLanguagePreferenceProviderInterface $userLanguagePreferenceProvider + ) { $this->contentTypeService = $contentTypeService; $this->userLanguagePreferenceProvider = $userLanguagePreferenceProvider; } /** - * {@inheritdoc} + * @return array> */ public function getChoiceList(): array { @@ -52,20 +49,14 @@ public function getChoiceList(): array return $contentTypesList; } - /** - * {@inheritdoc} - */ - public function loadChoiceList(callable $value = null) + public function loadChoiceList(callable $value = null): ChoiceListInterface { $choices = $this->getChoiceList(); return new ArrayChoiceList($choices, $value); } - /** - * {@inheritdoc} - */ - public function loadChoicesForValues(array $values, callable $value = null) + public function loadChoicesForValues(array $values, callable $value = null): array { // Optimize $values = array_filter($values); @@ -76,10 +67,7 @@ public function loadChoicesForValues(array $values, callable $value = null) return $this->loadChoiceList($value)->getChoicesForValues($values); } - /** - * {@inheritdoc} - */ - public function loadValuesForChoices(array $choices, callable $value = null) + public function loadValuesForChoices(array $choices, callable $value = null): array { // Optimize $choices = array_filter($choices); From 0000826ac284573962c71240dbba24f9fe894b19 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 19 Nov 2024 16:25:21 +0100 Subject: [PATCH 06/11] Upgraded Symfony Bundle extension points code --- .../DependencyInjection/IbexaSearchExtension.php | 10 ++++------ src/bundle/IbexaSearchBundle.php | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/bundle/DependencyInjection/IbexaSearchExtension.php b/src/bundle/DependencyInjection/IbexaSearchExtension.php index c5035d5..2242d56 100644 --- a/src/bundle/DependencyInjection/IbexaSearchExtension.php +++ b/src/bundle/DependencyInjection/IbexaSearchExtension.php @@ -16,7 +16,10 @@ class IbexaSearchExtension extends Extension implements PrependExtensionInterface { - public function load(array $configs, ContainerBuilder $container) + /** + * @throws \Exception + */ + public function load(array $configs, ContainerBuilder $container): void { $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); $loader->load('services.yaml'); @@ -24,17 +27,12 @@ public function load(array $configs, ContainerBuilder $container) /** * Allow an extension to prepend the extension configurations. - * - * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container */ public function prepend(ContainerBuilder $container): void { $this->prependJMSTranslation($container); } - /** - * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container - */ public function prependJMSTranslation(ContainerBuilder $container): void { $container->prependExtensionConfig('jms_translation', [ diff --git a/src/bundle/IbexaSearchBundle.php b/src/bundle/IbexaSearchBundle.php index b2b8a76..0e207d2 100644 --- a/src/bundle/IbexaSearchBundle.php +++ b/src/bundle/IbexaSearchBundle.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ +declare(strict_types=1); namespace Ibexa\Bundle\Search; @@ -15,7 +16,7 @@ class IbexaSearchBundle extends Bundle { - public function build(ContainerBuilder $container) + public function build(ContainerBuilder $container): void { /** @var \Ibexa\Bundle\Core\DependencyInjection\IbexaCoreExtension $core */ $core = $container->getExtension('ibexa'); From 785b8921cd54da196eefac502f18eb0a7fd7a5df Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 19 Nov 2024 16:25:45 +0100 Subject: [PATCH 07/11] Upgraded Ibexa Core extension points code --- .../DependencyInjection/Configuration/Parser/Search.php | 7 +------ .../Configuration/Parser/SearchView.php | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/bundle/DependencyInjection/Configuration/Parser/Search.php b/src/bundle/DependencyInjection/Configuration/Parser/Search.php index b24f63d..583769b 100644 --- a/src/bundle/DependencyInjection/Configuration/Parser/Search.php +++ b/src/bundle/DependencyInjection/Configuration/Parser/Search.php @@ -14,12 +14,7 @@ class Search extends AbstractParser { - /** - * Adds semantic configuration definition. - * - * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $nodeBuilder Node just under ezpublish.system. - */ - public function addSemanticConfig(NodeBuilder $nodeBuilder) + public function addSemanticConfig(NodeBuilder $nodeBuilder): void { $nodeBuilder ->arrayNode('search') diff --git a/src/bundle/DependencyInjection/Configuration/Parser/SearchView.php b/src/bundle/DependencyInjection/Configuration/Parser/SearchView.php index f45b90e..06ecc77 100644 --- a/src/bundle/DependencyInjection/Configuration/Parser/SearchView.php +++ b/src/bundle/DependencyInjection/Configuration/Parser/SearchView.php @@ -12,6 +12,6 @@ class SearchView extends View { - public const NODE_KEY = 'search_view'; - public const INFO = 'Template for displaying main search form and results'; + public const string NODE_KEY = 'search_view'; + public const string INFO = 'Template for displaying main search form and results'; } From 72adebfa4b285463940e3b1e3a5a130b3261756a Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 19 Nov 2024 16:26:17 +0100 Subject: [PATCH 08/11] Improved SearchFacetsExtension Twig extension code --- src/bundle/Twig/Extension/SearchFacetsExtension.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bundle/Twig/Extension/SearchFacetsExtension.php b/src/bundle/Twig/Extension/SearchFacetsExtension.php index bced76c..17d5426 100644 --- a/src/bundle/Twig/Extension/SearchFacetsExtension.php +++ b/src/bundle/Twig/Extension/SearchFacetsExtension.php @@ -24,7 +24,7 @@ public function getFilters(): array return [ new TwigFilter( 'ibexa_choices_as_facets', - [$this, 'getChoicesAsFacets'] + $this->getChoicesAsFacets(...) ), ]; } @@ -46,7 +46,7 @@ public function getChoicesAsFacets( if ($comparator === null) { $comparator = static function (ChoiceView $choice, TermAggregationResultEntry $term): bool { - return $choice->data == $term->getKey(); + return $choice->data === $term->getKey(); }; } From 3cffa6a61745c9dde2b71331804d8eb70fa088de Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 12 Dec 2024 16:39:43 +0100 Subject: [PATCH 09/11] [PHPStan] Removed resolved issues from the baseline --- phpstan-baseline.neon | 50 ------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1158007..46255f1 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,30 +1,10 @@ parameters: ignoreErrors: - - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\DependencyInjection\\\\Configuration\\\\Parser\\\\Search\\:\\:addSemanticConfig\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/DependencyInjection/Configuration/Parser/Search.php - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\DependencyInjection\\\\Configuration\\\\Parser\\\\Search\\:\\:mapConfig\\(\\) has parameter \\$scopeSettings with no value type specified in iterable type array\\.$#" count: 1 path: src/bundle/DependencyInjection/Configuration/Parser/Search.php - - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\DependencyInjection\\\\IbexaSearchExtension\\:\\:load\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/DependencyInjection/IbexaSearchExtension.php - - - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\Form\\\\ChoiceLoader\\\\ConfiguredLanguagesChoiceLoader\\:\\:getChoiceList\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/bundle/Form/ChoiceLoader/ConfiguredLanguagesChoiceLoader.php - - - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\Form\\\\ChoiceLoader\\\\ContentTypeChoiceLoader\\:\\:getChoiceList\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/bundle/Form/ChoiceLoader/ContentTypeChoiceLoader.php - - message: "#^Parameter \\#1 \\$array of function usort expects TArray of array\\, iterable\\ given\\.$#" count: 1 @@ -180,11 +160,6 @@ parameters: count: 1 path: src/bundle/Form/DataTransformer/UsersTransformer.php - - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\Form\\\\Type\\\\ContentTypeChoiceType\\:\\:configureOptions\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/Form/Type/ContentTypeChoiceType.php - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\Form\\\\Type\\\\DateIntervalType\\:\\:buildForm\\(\\) has no return type specified\\.$#" count: 1 @@ -200,41 +175,16 @@ parameters: count: 1 path: src/bundle/Form/Type/SearchType.php - - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\Form\\\\Type\\\\SearchType\\:\\:configureOptions\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/Form/Type/SearchType.php - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\Form\\\\Type\\\\SearchUsersType\\:\\:buildForm\\(\\) has no return type specified\\.$#" count: 1 path: src/bundle/Form/Type/SearchUsersType.php - - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\Form\\\\Type\\\\SearchUsersType\\:\\:configureOptions\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/Form/Type/SearchUsersType.php - - - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\Form\\\\Type\\\\SectionChoiceType\\:\\:configureOptions\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/Form/Type/SectionChoiceType.php - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\Form\\\\Type\\\\UserType\\:\\:buildForm\\(\\) has no return type specified\\.$#" count: 1 path: src/bundle/Form/Type/UserType.php - - - message: "#^Method Ibexa\\\\Bundle\\\\Search\\\\IbexaSearchBundle\\:\\:build\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/IbexaSearchBundle.php - - - - message: "#^Cannot access offset int on iterable\\\\.$#" - count: 1 - path: src/lib/Mapper/PagerSearchContentToDataMapper.php - - message: "#^Method Ibexa\\\\Search\\\\Mapper\\\\PagerSearchContentToDataMapper\\:\\:map\\(\\) has parameter \\$pager with generic class Pagerfanta\\\\Pagerfanta but does not specify its types\\: T$#" count: 1 From 4e184ccbcf5a7bf630e5c116ccf9fe4af132ad80 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 12 Dec 2024 16:47:41 +0100 Subject: [PATCH 10/11] Changed ContentTypeChoiceLoader constructor to use property promotion Co-Authored-By: Konrad Oboza --- .../Form/ChoiceLoader/ContentTypeChoiceLoader.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/bundle/Form/ChoiceLoader/ContentTypeChoiceLoader.php b/src/bundle/Form/ChoiceLoader/ContentTypeChoiceLoader.php index e14e428..aebc4e4 100644 --- a/src/bundle/Form/ChoiceLoader/ContentTypeChoiceLoader.php +++ b/src/bundle/Form/ChoiceLoader/ContentTypeChoiceLoader.php @@ -17,16 +17,10 @@ class ContentTypeChoiceLoader implements ChoiceLoaderInterface { - protected ContentTypeService $contentTypeService; - - private UserLanguagePreferenceProviderInterface $userLanguagePreferenceProvider; - public function __construct( - ContentTypeService $contentTypeService, - UserLanguagePreferenceProviderInterface $userLanguagePreferenceProvider + protected ContentTypeService $contentTypeService, + private readonly UserLanguagePreferenceProviderInterface $userLanguagePreferenceProvider ) { - $this->contentTypeService = $contentTypeService; - $this->userLanguagePreferenceProvider = $userLanguagePreferenceProvider; } /** From bf32f101ccf1c948ea19db2e81e7374718c4a813 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 12 Dec 2024 16:48:22 +0100 Subject: [PATCH 11/11] [Composer] Bumped Pagerfanta to v3 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f6ed0b2..459cd5a 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "require": { "php": " >=8.3", "ibexa/core": "dev-ibx-8470-symfony-6 as 5.0.x-dev", - "pagerfanta/pagerfanta": "^2.1", + "pagerfanta/pagerfanta": "^3.6.2", "symfony/config": "^6.4", "symfony/dependency-injection": "^6.4", "symfony/event-dispatcher": "^6.4",