From d5a6cdfa7b0eb82b422cc4a5cad111b5bb86381a Mon Sep 17 00:00:00 2001 From: Prokyonn Date: Thu, 1 Jun 2023 11:12:56 +0200 Subject: [PATCH] Fix linting errors (#250) --- .php-cs-fixer.dist.php | 2 ++ Content/Domain/Model/ShadowTrait.php | 2 +- Content/Infrastructure/Sulu/Search/ContentReindexProvider.php | 2 +- .../Sulu/Search/ContentSearchMetadataProvider.php | 2 +- .../Sulu/SmartContent/Provider/ContentDataProvider.php | 2 +- .../ExampleTestBundle/Exception/ExampleNotFoundException.php | 2 +- .../Infrastructure/Sulu/Teaser/ContentTeaserProviderTest.php | 2 +- .../Infrastructure/Sulu/Admin/ContentViewBuilderFactoryTest.php | 2 +- 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 2fd9ff01..0a4305de 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -31,6 +31,8 @@ 'single_line_throw' => false, 'strict_comparison' => true, 'strict_param' => true, + 'get_class_to_class_keyword' => false, // should be enabled as soon as support for php < 8 is dropped + 'nullable_type_declaration_for_default_null_value' => true, ]) ->setFinder( PhpCsFixer\Finder::create() diff --git a/Content/Domain/Model/ShadowTrait.php b/Content/Domain/Model/ShadowTrait.php index 3425cd29..af6fd217 100644 --- a/Content/Domain/Model/ShadowTrait.php +++ b/Content/Domain/Model/ShadowTrait.php @@ -23,7 +23,7 @@ trait ShadowTrait /** * @var string[]|null */ - protected $shadowLocales = null; + protected $shadowLocales; /** * @internal should only be set by content bundle services not from outside diff --git a/Content/Infrastructure/Sulu/Search/ContentReindexProvider.php b/Content/Infrastructure/Sulu/Search/ContentReindexProvider.php index e1fba99a..3a97116e 100644 --- a/Content/Infrastructure/Sulu/Search/ContentReindexProvider.php +++ b/Content/Infrastructure/Sulu/Search/ContentReindexProvider.php @@ -57,7 +57,7 @@ class ContentReindexProvider implements LocalizedReindexProviderInterface /** * @var class-string|null */ - private $dimensionContentClass = null; + private $dimensionContentClass; /** * @param class-string $contentRichEntityClass diff --git a/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php b/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php index 8c75b08b..10c03678 100644 --- a/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php +++ b/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php @@ -74,7 +74,7 @@ class ContentSearchMetadataProvider implements ProviderInterface /** * @var class-string|null */ - private $dimensionContentClass = null; + private $dimensionContentClass; /** * @param class-string $contentRichEntityClass diff --git a/Content/Infrastructure/Sulu/SmartContent/Provider/ContentDataProvider.php b/Content/Infrastructure/Sulu/SmartContent/Provider/ContentDataProvider.php index bacf5d4c..c7a43e6f 100644 --- a/Content/Infrastructure/Sulu/SmartContent/Provider/ContentDataProvider.php +++ b/Content/Infrastructure/Sulu/SmartContent/Provider/ContentDataProvider.php @@ -41,7 +41,7 @@ public function __construct( DataProviderRepositoryInterface $repository, ArraySerializerInterface $arraySerializer, ContentManagerInterface $contentManager, - ReferenceStoreInterface $referenceStore = null + ?ReferenceStoreInterface $referenceStore = null ) { parent::__construct($repository, $arraySerializer); diff --git a/Tests/Application/ExampleTestBundle/Exception/ExampleNotFoundException.php b/Tests/Application/ExampleTestBundle/Exception/ExampleNotFoundException.php index 6f712af3..aa6ff5d8 100644 --- a/Tests/Application/ExampleTestBundle/Exception/ExampleNotFoundException.php +++ b/Tests/Application/ExampleTestBundle/Exception/ExampleNotFoundException.php @@ -30,7 +30,7 @@ class ExampleNotFoundException extends \Exception /** * @param mixed[] $filters */ - public function __construct(array $filters, int $code = 0, \Throwable $previous = null) + public function __construct(array $filters, int $code = 0, ?\Throwable $previous = null) { $this->model = Example::class; diff --git a/Tests/Functional/Content/Infrastructure/Sulu/Teaser/ContentTeaserProviderTest.php b/Tests/Functional/Content/Infrastructure/Sulu/Teaser/ContentTeaserProviderTest.php index 4651d3c7..2e09b07f 100644 --- a/Tests/Functional/Content/Infrastructure/Sulu/Teaser/ContentTeaserProviderTest.php +++ b/Tests/Functional/Content/Infrastructure/Sulu/Teaser/ContentTeaserProviderTest.php @@ -162,7 +162,7 @@ public function testFindENNoRoute(): void } /** - * @param Teaser[]$teasers + * @param Teaser[] $teasers * * @return array */ diff --git a/Tests/Unit/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactoryTest.php b/Tests/Unit/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactoryTest.php index ff57832c..6dac5be1 100644 --- a/Tests/Unit/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactoryTest.php +++ b/Tests/Unit/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactoryTest.php @@ -55,7 +55,7 @@ class ContentViewBuilderFactoryTest extends TestCase protected function createContentViewBuilder( ContentMetadataInspectorInterface $contentMetadataInspector, SecurityCheckerInterface $securityChecker, - PreviewObjectProviderRegistryInterface $previewObjectProviderRegistry = null, + ?PreviewObjectProviderRegistryInterface $previewObjectProviderRegistry = null, array $settingsForms = [] ): ContentViewBuilderFactoryInterface { if (null === $previewObjectProviderRegistry) {