From 4ff99fa4d1845b0e2c4b5a8b0237792651b0b503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Wed, 15 Nov 2023 06:48:01 +0100 Subject: [PATCH] Applied code review suggestions --- phpstan-baseline.neon | 10 ---------- src/lib/Form/Type/Content/Draft/ContentCreateType.php | 4 +--- .../ContentTypeSuggestionsListenerTest.php | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index d84a667f7a..c636d6e958 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -6390,11 +6390,6 @@ parameters: count: 1 path: src/lib/Form/Type/Content/CustomUrl/CustomUrlRemoveType.php - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Form\\\\ChoiceList\\\\Loader\\\\ChoiceLoaderInterface\\:\\:setTargetLocation\\(\\)\\.$#" - count: 1 - path: src/lib/Form/Type/Content/Draft/ContentCreateType.php - - message: "#^Method Ibexa\\\\AdminUi\\\\Form\\\\Type\\\\Content\\\\Draft\\\\ContentCreateType\\:\\:buildForm\\(\\) has no return type specified\\.$#" count: 1 @@ -6415,11 +6410,6 @@ parameters: count: 1 path: src/lib/Form/Type/Content/Draft/ContentCreateType.php - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$contentTypeChoiceLoader$#" - count: 1 - path: src/lib/Form/Type/Content/Draft/ContentCreateType.php - - message: "#^Parameter \\#1 \\$languageChoiceLoader of class Ibexa\\\\AdminUi\\\\Form\\\\Type\\\\ChoiceList\\\\Loader\\\\ContentCreateLanguageChoiceLoader constructor expects Ibexa\\\\AdminUi\\\\Form\\\\Type\\\\ChoiceList\\\\Loader\\\\LanguageChoiceLoader, Symfony\\\\Component\\\\Form\\\\ChoiceList\\\\Loader\\\\ChoiceLoaderInterface given\\.$#" count: 1 diff --git a/src/lib/Form/Type/Content/Draft/ContentCreateType.php b/src/lib/Form/Type/Content/Draft/ContentCreateType.php index d33474d7a8..e6f7a2db34 100644 --- a/src/lib/Form/Type/Content/Draft/ContentCreateType.php +++ b/src/lib/Form/Type/Content/Draft/ContentCreateType.php @@ -30,8 +30,7 @@ class ContentCreateType extends AbstractType /** @var \Ibexa\Contracts\Core\Repository\LanguageService */ protected $languageService; - /** @var \Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface */ - private $contentCreateContentTypeChoiceLoader; + private ContentCreateContentTypeChoiceLoader $contentCreateContentTypeChoiceLoader; /** @var \Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface */ private $languageChoiceLoader; @@ -44,7 +43,6 @@ class ContentCreateType extends AbstractType /** * @param \Ibexa\Contracts\Core\Repository\LanguageService $languageService - * @param \Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface $contentTypeChoiceLoader * @param \Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface $languageChoiceLoader * @param \Ibexa\Contracts\AdminUi\Permission\PermissionCheckerInterface $permissionChecker * @param \Ibexa\AdminUi\Permission\LookupLimitationsTransformer $lookupLimitationsTransformer diff --git a/tests/lib/EventListener/ContentTypeSuggestionsListenerTest.php b/tests/lib/EventListener/ContentTypeSuggestionsListenerTest.php index 215fc97b3f..8d7414cb73 100644 --- a/tests/lib/EventListener/ContentTypeSuggestionsListenerTest.php +++ b/tests/lib/EventListener/ContentTypeSuggestionsListenerTest.php @@ -46,7 +46,7 @@ public function testSubscribedEvents(): void ], $actualSubservients); } - public function testSkipSuggestionComputationIfAggregationApiIsNotSupported(): void + public function testSkipSuggestionComputationIfAggregationAPIIsNotSupported(): void { $this->disableSupportForAggregationAPI(); $this->expectSuggestionsAreNotComputed();