diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 76416958..c7ff84db 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -11,30 +11,33 @@ $config = new PhpCsFixer\Config(); $config->setRiskyAllowed(true) + ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) ->setRules([ '@Symfony' => true, - '@Symfony:risky' => true, + 'array_syntax' => ['syntax' => 'short'], 'class_definition' => false, 'concat_space' => ['spacing' => 'one'], - 'declare_strict_types' => true, 'function_declaration' => ['closure_function_spacing' => 'none'], 'header_comment' => ['header' => $header], + 'native_constant_invocation' => true, + 'native_function_casing' => true, 'native_function_invocation' => ['include' => ['@internal']], + 'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false], 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => true], - 'no_useless_else' => true, - 'no_useless_return' => true, - 'php_unit_strict' => true, + 'ordered_imports' => true, 'phpdoc_align' => ['align' => 'left'], - 'phpdoc_order' => true, - 'phpdoc_to_comment' => false, 'phpdoc_types_order' => false, '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 + 'single_line_comment_spacing' => false, + 'phpdoc_to_comment' => [ + 'ignored_tags' => ['todo', 'var'], + ], + 'get_class_to_class_keyword' => true, 'nullable_type_declaration_for_default_null_value' => true, 'no_null_property_initialization' => false, + 'fully_qualified_strict_types' => false, 'new_with_parentheses' => true, + 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays', 'match']], ]) ->setFinder( PhpCsFixer\Finder::create() diff --git a/Content/Application/ContentCopier/ContentCopier.php b/Content/Application/ContentCopier/ContentCopier.php index b98b6881..c7c892f5 100644 --- a/Content/Application/ContentCopier/ContentCopier.php +++ b/Content/Application/ContentCopier/ContentCopier.php @@ -47,7 +47,7 @@ public function __construct( ContentResolverInterface $contentResolver, ContentMergerInterface $contentMerger, ContentPersisterInterface $contentPersister, - ContentNormalizerInterface $contentNormalizer + ContentNormalizerInterface $contentNormalizer, ) { $this->contentResolver = $contentResolver; $this->contentMerger = $contentMerger; @@ -60,7 +60,7 @@ public function copy( array $sourceDimensionAttributes, ContentRichEntityInterface $targetContentRichEntity, array $targetDimensionAttributes, - array $options = [] + array $options = [], ): DimensionContentInterface { $sourceDimensionContent = $this->contentResolver->resolve($sourceContentRichEntity, $sourceDimensionAttributes); @@ -71,7 +71,7 @@ public function copyFromDimensionContentCollection( DimensionContentCollectionInterface $dimensionContentCollection, ContentRichEntityInterface $targetContentRichEntity, array $targetDimensionAttributes, - array $options = [] + array $options = [], ): DimensionContentInterface { $sourceDimensionContent = $this->contentMerger->merge($dimensionContentCollection); @@ -82,7 +82,7 @@ public function copyFromDimensionContent( DimensionContentInterface $dimensionContent, ContentRichEntityInterface $targetContentRichEntity, array $targetDimensionAttributes, - array $options = [] + array $options = [], ): DimensionContentInterface { $data = \array_replace($this->contentNormalizer->normalize($dimensionContent), $options['data'] ?? []); diff --git a/Content/Application/ContentCopier/ContentCopierInterface.php b/Content/Application/ContentCopier/ContentCopierInterface.php index 44935681..24966587 100644 --- a/Content/Application/ContentCopier/ContentCopierInterface.php +++ b/Content/Application/ContentCopier/ContentCopierInterface.php @@ -35,7 +35,7 @@ public function copy( array $sourceDimensionAttributes, ContentRichEntityInterface $targetContentRichEntity, array $targetDimensionAttributes, - array $options = [] + array $options = [], ): DimensionContentInterface; /** @@ -52,7 +52,7 @@ public function copyFromDimensionContentCollection( DimensionContentCollectionInterface $dimensionContentCollection, ContentRichEntityInterface $targetContentRichEntity, array $targetDimensionAttributes, - array $options = [] + array $options = [], ): DimensionContentInterface; /** @@ -69,6 +69,6 @@ public function copyFromDimensionContent( DimensionContentInterface $dimensionContent, ContentRichEntityInterface $targetContentRichEntity, array $targetDimensionAttributes, - array $options = [] + array $options = [], ): DimensionContentInterface; } diff --git a/Content/Application/ContentDataMapper/ContentDataMapper.php b/Content/Application/ContentDataMapper/ContentDataMapper.php index d654912b..5bdd62db 100644 --- a/Content/Application/ContentDataMapper/ContentDataMapper.php +++ b/Content/Application/ContentDataMapper/ContentDataMapper.php @@ -34,7 +34,7 @@ public function __construct(iterable $dataMappers) public function map( DimensionContentCollectionInterface $dimensionContentCollection, array $dimensionAttributes, - array $data + array $data, ): void { $localizedDimensionAttributes = $dimensionAttributes; $unlocalizedDimensionAttributes = $dimensionAttributes; diff --git a/Content/Application/ContentDataMapper/ContentDataMapperInterface.php b/Content/Application/ContentDataMapper/ContentDataMapperInterface.php index 06984214..eb9bc84d 100644 --- a/Content/Application/ContentDataMapper/ContentDataMapperInterface.php +++ b/Content/Application/ContentDataMapper/ContentDataMapperInterface.php @@ -28,6 +28,6 @@ interface ContentDataMapperInterface public function map( DimensionContentCollectionInterface $dimensionContentCollection, array $dimensionAttributes, - array $data + array $data, ): void; } diff --git a/Content/Application/ContentDataMapper/DataMapper/AuthorDataMapper.php b/Content/Application/ContentDataMapper/DataMapper/AuthorDataMapper.php index f4bf7cf7..059eefba 100644 --- a/Content/Application/ContentDataMapper/DataMapper/AuthorDataMapper.php +++ b/Content/Application/ContentDataMapper/DataMapper/AuthorDataMapper.php @@ -32,7 +32,7 @@ public function __construct(ContactFactoryInterface $contactFactory) public function map( DimensionContentInterface $unlocalizedDimensionContent, DimensionContentInterface $localizedDimensionContent, - array $data + array $data, ): void { if (!$localizedDimensionContent instanceof AuthorInterface) { return; diff --git a/Content/Application/ContentDataMapper/DataMapper/DataMapperInterface.php b/Content/Application/ContentDataMapper/DataMapper/DataMapperInterface.php index 56a65ba9..eb1ece31 100644 --- a/Content/Application/ContentDataMapper/DataMapper/DataMapperInterface.php +++ b/Content/Application/ContentDataMapper/DataMapper/DataMapperInterface.php @@ -27,6 +27,6 @@ interface DataMapperInterface public function map( DimensionContentInterface $unlocalizedDimensionContent, DimensionContentInterface $localizedDimensionContent, - array $data + array $data, ): void; } diff --git a/Content/Application/ContentDataMapper/DataMapper/ExcerptDataMapper.php b/Content/Application/ContentDataMapper/DataMapper/ExcerptDataMapper.php index 8894f559..13876443 100644 --- a/Content/Application/ContentDataMapper/DataMapper/ExcerptDataMapper.php +++ b/Content/Application/ContentDataMapper/DataMapper/ExcerptDataMapper.php @@ -39,7 +39,7 @@ public function __construct(TagFactoryInterface $tagFactory, CategoryFactoryInte public function map( DimensionContentInterface $unlocalizedDimensionContent, DimensionContentInterface $localizedDimensionContent, - array $data + array $data, ): void { if (!$localizedDimensionContent instanceof ExcerptInterface) { return; diff --git a/Content/Application/ContentDataMapper/DataMapper/RoutableDataMapper.php b/Content/Application/ContentDataMapper/DataMapper/RoutableDataMapper.php index 3c499a5e..9b177d98 100644 --- a/Content/Application/ContentDataMapper/DataMapper/RoutableDataMapper.php +++ b/Content/Application/ContentDataMapper/DataMapper/RoutableDataMapper.php @@ -59,7 +59,7 @@ public function __construct( RouteGeneratorInterface $routeGenerator, RouteManagerInterface $routeManager, ConflictResolverInterface $conflictResolver, - array $routeMappings + array $routeMappings, ) { $this->factory = $factory; $this->routeGenerator = $routeGenerator; @@ -71,7 +71,7 @@ public function __construct( public function map( DimensionContentInterface $unlocalizedDimensionContent, DimensionContentInterface $localizedDimensionContent, - array $data + array $data, ): void { if (!$localizedDimensionContent instanceof RoutableInterface) { return; diff --git a/Content/Application/ContentDataMapper/DataMapper/SeoDataMapper.php b/Content/Application/ContentDataMapper/DataMapper/SeoDataMapper.php index 09d65dbf..c6e5bcf2 100644 --- a/Content/Application/ContentDataMapper/DataMapper/SeoDataMapper.php +++ b/Content/Application/ContentDataMapper/DataMapper/SeoDataMapper.php @@ -21,7 +21,7 @@ class SeoDataMapper implements DataMapperInterface public function map( DimensionContentInterface $unlocalizedDimensionContent, DimensionContentInterface $localizedDimensionContent, - array $data + array $data, ): void { if (!$localizedDimensionContent instanceof SeoInterface) { return; diff --git a/Content/Application/ContentDataMapper/DataMapper/ShadowDataMapper.php b/Content/Application/ContentDataMapper/DataMapper/ShadowDataMapper.php index ac397a71..2125f236 100644 --- a/Content/Application/ContentDataMapper/DataMapper/ShadowDataMapper.php +++ b/Content/Application/ContentDataMapper/DataMapper/ShadowDataMapper.php @@ -21,7 +21,7 @@ class ShadowDataMapper implements DataMapperInterface public function map( DimensionContentInterface $unlocalizedDimensionContent, DimensionContentInterface $localizedDimensionContent, - array $data + array $data, ): void { if (!$unlocalizedDimensionContent instanceof ShadowInterface || !$localizedDimensionContent instanceof ShadowInterface diff --git a/Content/Application/ContentDataMapper/DataMapper/TemplateDataMapper.php b/Content/Application/ContentDataMapper/DataMapper/TemplateDataMapper.php index 6a2cd042..99bcc204 100644 --- a/Content/Application/ContentDataMapper/DataMapper/TemplateDataMapper.php +++ b/Content/Application/ContentDataMapper/DataMapper/TemplateDataMapper.php @@ -41,7 +41,7 @@ public function __construct(StructureMetadataFactoryInterface $factory, array $s public function map( DimensionContentInterface $unlocalizedDimensionContent, DimensionContentInterface $localizedDimensionContent, - array $data + array $data, ): void { if (!$localizedDimensionContent instanceof TemplateInterface || !$unlocalizedDimensionContent instanceof TemplateInterface @@ -96,7 +96,7 @@ private function getTemplateData( string $type, string $template, array $unlocalizedData, - array $localizedData + array $localizedData, ): array { $metadata = $this->factory->getStructureMetadata($type, $template); diff --git a/Content/Application/ContentDataMapper/DataMapper/WebspaceDataMapper.php b/Content/Application/ContentDataMapper/DataMapper/WebspaceDataMapper.php index 66ea7558..8b8cfcb0 100644 --- a/Content/Application/ContentDataMapper/DataMapper/WebspaceDataMapper.php +++ b/Content/Application/ContentDataMapper/DataMapper/WebspaceDataMapper.php @@ -37,7 +37,7 @@ public function __construct(WebspaceManagerInterface $webspaceManager) public function map( DimensionContentInterface $unlocalizedDimensionContent, DimensionContentInterface $localizedDimensionContent, - array $data + array $data, ): void { if (!$localizedDimensionContent instanceof WebspaceInterface) { return; diff --git a/Content/Application/ContentDataMapper/DataMapper/WorkflowDataMapper.php b/Content/Application/ContentDataMapper/DataMapper/WorkflowDataMapper.php index 3c905775..de9c172c 100644 --- a/Content/Application/ContentDataMapper/DataMapper/WorkflowDataMapper.php +++ b/Content/Application/ContentDataMapper/DataMapper/WorkflowDataMapper.php @@ -21,7 +21,7 @@ class WorkflowDataMapper implements DataMapperInterface public function map( DimensionContentInterface $unlocalizedDimensionContent, DimensionContentInterface $localizedDimensionContent, - array $data + array $data, ): void { if (!$localizedDimensionContent instanceof WorkflowInterface) { return; diff --git a/Content/Application/ContentIndexer/ContentIndexer.php b/Content/Application/ContentIndexer/ContentIndexer.php index a7087b4e..4a033381 100644 --- a/Content/Application/ContentIndexer/ContentIndexer.php +++ b/Content/Application/ContentIndexer/ContentIndexer.php @@ -100,7 +100,7 @@ public function deindexDimensionContent(DimensionContentInterface $dimensionCont */ private function loadDimensionContent( ContentRichEntityInterface $contentRichEntity, - array $dimensionAttributes + array $dimensionAttributes, ): DimensionContentInterface { $locale = $dimensionAttributes['locale'] ?? null; $stage = $dimensionAttributes['stage'] ?? null; diff --git a/Content/Application/ContentManager/ContentManager.php b/Content/Application/ContentManager/ContentManager.php index b78c6051..ab506579 100644 --- a/Content/Application/ContentManager/ContentManager.php +++ b/Content/Application/ContentManager/ContentManager.php @@ -60,7 +60,7 @@ public function __construct( ContentNormalizerInterface $contentNormalizer, ContentCopierInterface $contentCopier, ContentWorkflowInterface $contentWorkflow, - ContentIndexerInterface $contentIndexer + ContentIndexerInterface $contentIndexer, ) { $this->contentResolver = $contentResolver; $this->contentPersister = $contentPersister; @@ -89,7 +89,7 @@ public function copy( ContentRichEntityInterface $sourceContentRichEntity, array $sourceDimensionAttributes, ContentRichEntityInterface $targetContentRichEntity, - array $targetDimensionAttributes + array $targetDimensionAttributes, ): DimensionContentInterface { return $this->contentCopier->copy( $sourceContentRichEntity, @@ -102,7 +102,7 @@ public function copy( public function applyTransition( ContentRichEntityInterface $contentRichEntity, array $dimensionAttributes, - string $transitionName + string $transitionName, ): DimensionContentInterface { return $this->contentWorkflow->apply($contentRichEntity, $dimensionAttributes, $transitionName); } diff --git a/Content/Application/ContentManager/ContentManagerInterface.php b/Content/Application/ContentManager/ContentManagerInterface.php index 100eb1c5..3e7c28dd 100644 --- a/Content/Application/ContentManager/ContentManagerInterface.php +++ b/Content/Application/ContentManager/ContentManagerInterface.php @@ -62,7 +62,7 @@ public function copy( ContentRichEntityInterface $sourceContentRichEntity, array $sourceDimensionAttributes, ContentRichEntityInterface $targetContentRichEntity, - array $targetDimensionAttributes + array $targetDimensionAttributes, ): DimensionContentInterface; /** @@ -76,7 +76,7 @@ public function copy( public function applyTransition( ContentRichEntityInterface $contentRichEntity, array $dimensionAttributes, - string $transitionName + string $transitionName, ): DimensionContentInterface; /** diff --git a/Content/Application/ContentMerger/ContentMerger.php b/Content/Application/ContentMerger/ContentMerger.php index 80a23dc8..560ddd01 100644 --- a/Content/Application/ContentMerger/ContentMerger.php +++ b/Content/Application/ContentMerger/ContentMerger.php @@ -36,7 +36,7 @@ class ContentMerger implements ContentMergerInterface */ public function __construct( iterable $mergers, - PropertyAccessor $propertyAccessor + PropertyAccessor $propertyAccessor, ) { $this->mergers = $mergers; $this->propertyAccessor = $propertyAccessor; diff --git a/Content/Application/ContentNormalizer/ContentNormalizer.php b/Content/Application/ContentNormalizer/ContentNormalizer.php index 2130d194..fad4234c 100644 --- a/Content/Application/ContentNormalizer/ContentNormalizer.php +++ b/Content/Application/ContentNormalizer/ContentNormalizer.php @@ -36,7 +36,7 @@ class ContentNormalizer implements ContentNormalizerInterface */ public function __construct( iterable $normalizers, - ?SymfonyNormalizerInterface $serializer = null + ?SymfonyNormalizerInterface $serializer = null, ) { $this->normalizers = $normalizers; $this->serializer = $serializer ?: $this->createSerializer(); diff --git a/Content/Application/ContentPersister/ContentPersister.php b/Content/Application/ContentPersister/ContentPersister.php index c06317aa..aa18be39 100644 --- a/Content/Application/ContentPersister/ContentPersister.php +++ b/Content/Application/ContentPersister/ContentPersister.php @@ -32,7 +32,7 @@ class ContentPersister implements ContentPersisterInterface public function __construct( DimensionContentCollectionFactoryInterface $dimensionContentCollectionFactory, - ContentMergerInterface $contentMerger + ContentMergerInterface $contentMerger, ) { $this->dimensionContentCollectionFactory = $dimensionContentCollectionFactory; $this->contentMerger = $contentMerger; diff --git a/Content/Application/ContentResolver/ContentResolver.php b/Content/Application/ContentResolver/ContentResolver.php index 36f4f1f9..ac6214f1 100644 --- a/Content/Application/ContentResolver/ContentResolver.php +++ b/Content/Application/ContentResolver/ContentResolver.php @@ -33,7 +33,7 @@ class ContentResolver implements ContentResolverInterface public function __construct( DimensionContentRepositoryInterface $dimensionContentRepository, - ContentMergerInterface $contentMerger + ContentMergerInterface $contentMerger, ) { $this->dimensionContentRepository = $dimensionContentRepository; $this->contentMerger = $contentMerger; diff --git a/Content/Application/ContentWorkflow/ContentWorkflow.php b/Content/Application/ContentWorkflow/ContentWorkflow.php index 5b18ab23..2bdc83de 100644 --- a/Content/Application/ContentWorkflow/ContentWorkflow.php +++ b/Content/Application/ContentWorkflow/ContentWorkflow.php @@ -59,7 +59,7 @@ public function __construct( DimensionContentRepositoryInterface $dimensionContentRepository, ContentMergerInterface $contentMerger, ?Registry $workflowRegistry = null, - ?EventDispatcherInterface $eventDispatcher = null + ?EventDispatcherInterface $eventDispatcher = null, ) { $this->dimensionContentRepository = $dimensionContentRepository; $this->contentMerger = $contentMerger; @@ -75,7 +75,7 @@ public function __construct( public function apply( ContentRichEntityInterface $contentRichEntity, array $dimensionAttributes, - string $transitionName + string $transitionName, ): DimensionContentInterface { /* * Transition should always be applied to the STAGE_DRAFT content-dimension of the given $dimensionAttributes. @@ -94,7 +94,7 @@ public function apply( } if (!$localizedDimensionContent instanceof WorkflowInterface) { - throw new \RuntimeException(\sprintf('Expected "%s" but "%s" given.', WorkflowInterface::class, \get_class($localizedDimensionContent))); + throw new \RuntimeException(\sprintf('Expected "%s" but "%s" given.', WorkflowInterface::class, $localizedDimensionContent::class)); } $workflow = $this->workflowRegistry->get( diff --git a/Content/Application/ContentWorkflow/ContentWorkflowInterface.php b/Content/Application/ContentWorkflow/ContentWorkflowInterface.php index e1919819..34a1196f 100644 --- a/Content/Application/ContentWorkflow/ContentWorkflowInterface.php +++ b/Content/Application/ContentWorkflow/ContentWorkflowInterface.php @@ -33,6 +33,6 @@ interface ContentWorkflowInterface public function apply( ContentRichEntityInterface $contentRichEntity, array $dimensionAttributes, - string $transitionName + string $transitionName, ): DimensionContentInterface; } diff --git a/Content/Application/ContentWorkflow/Subscriber/UnpublishTransitionSubscriber.php b/Content/Application/ContentWorkflow/Subscriber/UnpublishTransitionSubscriber.php index b361f7e2..d03bbbcd 100644 --- a/Content/Application/ContentWorkflow/Subscriber/UnpublishTransitionSubscriber.php +++ b/Content/Application/ContentWorkflow/Subscriber/UnpublishTransitionSubscriber.php @@ -43,7 +43,7 @@ class UnpublishTransitionSubscriber implements EventSubscriberInterface public function __construct( DimensionContentRepositoryInterface $dimensionContentRepository, - EntityManagerInterface $entityManager + EntityManagerInterface $entityManager, ) { $this->dimensionContentRepository = $dimensionContentRepository; $this->entityManager = $entityManager; diff --git a/Content/Application/DimensionContentCollectionFactory/DimensionContentCollectionFactory.php b/Content/Application/DimensionContentCollectionFactory/DimensionContentCollectionFactory.php index dc1891d8..e64f17b4 100644 --- a/Content/Application/DimensionContentCollectionFactory/DimensionContentCollectionFactory.php +++ b/Content/Application/DimensionContentCollectionFactory/DimensionContentCollectionFactory.php @@ -43,7 +43,7 @@ class DimensionContentCollectionFactory implements DimensionContentCollectionFac public function __construct( DimensionContentRepositoryInterface $dimensionContentRepository, ContentDataMapperInterface $contentDataMapper, - PropertyAccessor $propertyAccessor + PropertyAccessor $propertyAccessor, ) { $this->dimensionContentRepository = $dimensionContentRepository; $this->contentDataMapper = $contentDataMapper; @@ -53,7 +53,7 @@ public function __construct( public function create( ContentRichEntityInterface $contentRichEntity, array $dimensionAttributes, - array $data + array $data, ): DimensionContentCollectionInterface { $dimensionContentCollection = $this->dimensionContentRepository->load($contentRichEntity, $dimensionAttributes); $dimensionAttributes = $dimensionContentCollection->getDimensionAttributes(); @@ -114,7 +114,7 @@ public function create( */ private function createContentDimension( ContentRichEntityInterface $contentRichEntity, - array $attributes + array $attributes, ): DimensionContentInterface { $dimensionContent = $contentRichEntity->createDimensionContent(); diff --git a/Content/Domain/Factory/DimensionContentCollectionFactoryInterface.php b/Content/Domain/Factory/DimensionContentCollectionFactoryInterface.php index 80b119f9..3b05cffe 100644 --- a/Content/Domain/Factory/DimensionContentCollectionFactoryInterface.php +++ b/Content/Domain/Factory/DimensionContentCollectionFactoryInterface.php @@ -31,6 +31,6 @@ interface DimensionContentCollectionFactoryInterface public function create( ContentRichEntityInterface $contentRichEntity, array $dimensionAttributes, - array $data + array $data, ): DimensionContentCollectionInterface; } diff --git a/Content/Domain/Model/DimensionContentCollection.php b/Content/Domain/Model/DimensionContentCollection.php index 2c972bd2..47626047 100644 --- a/Content/Domain/Model/DimensionContentCollection.php +++ b/Content/Domain/Model/DimensionContentCollection.php @@ -55,7 +55,7 @@ class DimensionContentCollection implements \IteratorAggregate, DimensionContent public function __construct( array $dimensionContents, array $dimensionAttributes, - string $dimensionContentClass + string $dimensionContentClass, ) { $this->dimensionContentClass = $dimensionContentClass; $this->defaultDimensionAttributes = $dimensionContentClass::getDefaultDimensionAttributes(); diff --git a/Content/Domain/Repository/DimensionContentRepositoryInterface.php b/Content/Domain/Repository/DimensionContentRepositoryInterface.php index b0f8743c..c6194d07 100644 --- a/Content/Domain/Repository/DimensionContentRepositoryInterface.php +++ b/Content/Domain/Repository/DimensionContentRepositoryInterface.php @@ -29,6 +29,6 @@ interface DimensionContentRepositoryInterface */ public function load( ContentRichEntityInterface $contentRichEntity, - array $dimensionAttributes + array $dimensionAttributes, ): DimensionContentCollectionInterface; } diff --git a/Content/Infrastructure/Doctrine/DimensionContentQueryEnhancer.php b/Content/Infrastructure/Doctrine/DimensionContentQueryEnhancer.php index f241371e..a8f71adc 100644 --- a/Content/Infrastructure/Doctrine/DimensionContentQueryEnhancer.php +++ b/Content/Infrastructure/Doctrine/DimensionContentQueryEnhancer.php @@ -90,7 +90,7 @@ public function addFilters( string $contentRichEntityAlias, string $dimensionContentClassName, array $filters, - array $sortBys + array $sortBys, ): void { $effectiveAttributes = $dimensionContentClassName::getEffectiveDimensionAttributes($filters); @@ -210,7 +210,7 @@ private function addJoinFilter( string $targetField, string $filterKey, array $parameters, - string $operator = 'OR' + string $operator = 'OR', ): void { if ('OR' === $operator) { $queryBuilder->leftJoin( @@ -261,7 +261,7 @@ public function addSelects( QueryBuilder $queryBuilder, string $dimensionContentClassName, array $dimensionAttributes, - array $selects = [] + array $selects = [], ): void { foreach ($selects as $selectGroup => $value) { if (!$value) { diff --git a/Content/Infrastructure/Doctrine/DimensionContentRepository.php b/Content/Infrastructure/Doctrine/DimensionContentRepository.php index 3222199e..506fad12 100644 --- a/Content/Infrastructure/Doctrine/DimensionContentRepository.php +++ b/Content/Infrastructure/Doctrine/DimensionContentRepository.php @@ -41,7 +41,7 @@ class DimensionContentRepository implements DimensionContentRepositoryInterface public function __construct( EntityManagerInterface $entityManager, ContentMetadataInspectorInterface $contentMetadataInspector, - DimensionContentQueryEnhancer $dimensionContentQueryEnhancer + DimensionContentQueryEnhancer $dimensionContentQueryEnhancer, ) { $this->entityManager = $entityManager; $this->contentMetadataInspector = $contentMetadataInspector; @@ -58,10 +58,10 @@ public function __construct( */ public function load( ContentRichEntityInterface $contentRichEntity, - array $dimensionAttributes + array $dimensionAttributes, ): DimensionContentCollectionInterface { - $dimensionContentClass = $this->contentMetadataInspector->getDimensionContentClass(\get_class($contentRichEntity)); - $mappingProperty = $this->contentMetadataInspector->getDimensionContentPropertyName(\get_class($contentRichEntity)); + $dimensionContentClass = $this->contentMetadataInspector->getDimensionContentClass($contentRichEntity::class); + $mappingProperty = $this->contentMetadataInspector->getDimensionContentPropertyName($contentRichEntity::class); $queryBuilder = $this->entityManager->createQueryBuilder() ->from($dimensionContentClass, 'dimensionContent') diff --git a/Content/Infrastructure/Doctrine/MetadataLoader.php b/Content/Infrastructure/Doctrine/MetadataLoader.php index 181a3b9f..8ced209e 100644 --- a/Content/Infrastructure/Doctrine/MetadataLoader.php +++ b/Content/Infrastructure/Doctrine/MetadataLoader.php @@ -132,7 +132,7 @@ private function addManyToOne( ClassMetadataInfo $metadata, string $name, string $class, - bool $nullable = false + bool $nullable = false, ): void { if ($metadata->hasAssociation($name)) { return; @@ -165,7 +165,7 @@ private function addManyToMany( ClassMetadataInfo $metadata, string $name, string $class, - string $inverseColumnName + string $inverseColumnName, ): void { if ($metadata->hasAssociation($name)) { return; diff --git a/Content/Infrastructure/Doctrine/RouteRemover.php b/Content/Infrastructure/Doctrine/RouteRemover.php index e1d07528..feb5bd98 100644 --- a/Content/Infrastructure/Doctrine/RouteRemover.php +++ b/Content/Infrastructure/Doctrine/RouteRemover.php @@ -48,7 +48,7 @@ class RouteRemover implements EventSubscriber public function __construct( ContentMetadataInspectorInterface $contentMetadataInspector, RouteRepositoryInterface $routeRepository, - array $routeMappings + array $routeMappings, ) { $this->routeRepository = $routeRepository; $this->contentMetadataInspector = $contentMetadataInspector; @@ -67,7 +67,7 @@ public function preRemove(LifecycleEventArgs $event): void return; // @codeCoverageIgnore } - $dimensionContentClass = $this->contentMetadataInspector->getDimensionContentClass(\get_class($object)); + $dimensionContentClass = $this->contentMetadataInspector->getDimensionContentClass($object::class); $resourceKey = $dimensionContentClass::getResourceKey(); $entityClass = null; diff --git a/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactory.php b/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactory.php index 9088217e..fde8bec2 100644 --- a/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactory.php +++ b/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactory.php @@ -67,7 +67,7 @@ public function __construct( PreviewObjectProviderRegistryInterface $objectProviderRegistry, ContentMetadataInspectorInterface $contentMetadataInspector, SecurityCheckerInterface $securityChecker, - array $settingsForms + array $settingsForms, ) { $this->viewBuilderFactory = $viewBuilderFactory; $this->objectProviderRegistry = $objectProviderRegistry; @@ -77,7 +77,7 @@ public function __construct( } public function getDefaultToolbarActions( - string $contentRichEntityClass + string $contentRichEntityClass, ): array { $dimensionContentClass = $this->contentMetadataInspector->getDimensionContentClass($contentRichEntityClass); @@ -142,7 +142,7 @@ public function createViews( string $editParentView, ?string $addParentView = null, ?string $securityContext = null, - ?array $toolbarActions = null + ?array $toolbarActions = null, ): array { $dimensionContentClass = $this->contentMetadataInspector->getDimensionContentClass($contentRichEntityClass); @@ -253,7 +253,7 @@ private function createTemplateFormView( bool $previewEnabled, string $resourceKey, string $formKey, - array $toolbarActions + array $toolbarActions, ): ViewBuilderInterface { return $this->createFormViewBuilder($parentView . '.content', '/content', $previewEnabled) ->setResourceKey($resourceKey) @@ -271,7 +271,7 @@ private function createSeoFormView( string $parentView, bool $previewEnabled, string $resourceKey, - array $toolbarActions + array $toolbarActions, ): ViewBuilderInterface { return $this->createFormViewBuilder($parentView . '.seo', '/seo', $previewEnabled) ->setResourceKey($resourceKey) @@ -290,7 +290,7 @@ private function createExcerptFormView( string $parentView, bool $previewEnabled, string $resourceKey, - array $toolbarActions + array $toolbarActions, ): ViewBuilderInterface { return $this->createFormViewBuilder($parentView . '.excerpt', '/excerpt', $previewEnabled) ->setResourceKey($resourceKey) @@ -310,7 +310,7 @@ private function createSettingsFormView( bool $previewEnabled, string $resourceKey, array $toolbarActions, - string $dimensionContentClass + string $dimensionContentClass, ): ViewBuilderInterface { $forms = []; foreach ($this->settingsForms as $key => $tag) { diff --git a/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactoryInterface.php b/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactoryInterface.php index 622da7e0..50859eb3 100644 --- a/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactoryInterface.php +++ b/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactoryInterface.php @@ -28,7 +28,7 @@ interface ContentViewBuilderFactoryInterface * @return array */ public function getDefaultToolbarActions( - string $contentRichEntityClass + string $contentRichEntityClass, ): array; /** @@ -44,6 +44,6 @@ public function createViews( string $editParentView, ?string $addParentView = null, ?string $securityContext = null, - ?array $toolbarActions = null + ?array $toolbarActions = null, ): array; } diff --git a/Content/Infrastructure/Sulu/Link/ContentLinkProvider.php b/Content/Infrastructure/Sulu/Link/ContentLinkProvider.php index 42126186..f84dc840 100644 --- a/Content/Infrastructure/Sulu/Link/ContentLinkProvider.php +++ b/Content/Infrastructure/Sulu/Link/ContentLinkProvider.php @@ -64,7 +64,7 @@ public function __construct( ContentManagerInterface $contentManager, StructureMetadataFactoryInterface $structureMetadataFactory, EntityManagerInterface $entityManager, - string $contentRichEntityClass + string $contentRichEntityClass, ) { $this->contentManager = $contentManager; $this->structureMetadataFactory = $structureMetadataFactory; diff --git a/Content/Infrastructure/Sulu/Preview/ContentObjectProvider.php b/Content/Infrastructure/Sulu/Preview/ContentObjectProvider.php index 36bd4cdf..0e5d885a 100644 --- a/Content/Infrastructure/Sulu/Preview/ContentObjectProvider.php +++ b/Content/Infrastructure/Sulu/Preview/ContentObjectProvider.php @@ -63,7 +63,7 @@ public function __construct( ContentResolverInterface $contentResolver, ContentDataMapperInterface $contentDataMapper, string $contentRichEntityClass, - ?string $securityContext = null + ?string $securityContext = null, ) { $this->entityManager = $entityManager; $this->contentResolver = $contentResolver; diff --git a/Content/Infrastructure/Sulu/Preview/PreviewDimensionContentCollection.php b/Content/Infrastructure/Sulu/Preview/PreviewDimensionContentCollection.php index 54cc12be..1765c752 100644 --- a/Content/Infrastructure/Sulu/Preview/PreviewDimensionContentCollection.php +++ b/Content/Infrastructure/Sulu/Preview/PreviewDimensionContentCollection.php @@ -42,7 +42,7 @@ class PreviewDimensionContentCollection implements \IteratorAggregate, Dimension */ public function __construct( DimensionContentInterface $previewDimensionContent, - string $previewLocale + string $previewLocale, ) { $this->previewDimensionContent = $previewDimensionContent; $this->previewLocale = $previewLocale; diff --git a/Content/Infrastructure/Sulu/Route/ContentRouteDefaultsProvider.php b/Content/Infrastructure/Sulu/Route/ContentRouteDefaultsProvider.php index 72ce500f..b5777ef2 100644 --- a/Content/Infrastructure/Sulu/Route/ContentRouteDefaultsProvider.php +++ b/Content/Infrastructure/Sulu/Route/ContentRouteDefaultsProvider.php @@ -52,7 +52,7 @@ public function __construct( EntityManagerInterface $entityManager, ContentResolverInterface $contentResolver, ContentStructureBridgeFactory $contentStructureBridgeFactory, - CacheLifetimeResolverInterface $cacheLifetimeResolver + CacheLifetimeResolverInterface $cacheLifetimeResolver, ) { $this->entityManager = $entityManager; $this->contentResolver = $contentResolver; @@ -80,7 +80,7 @@ public function getByEntity($entityClass, $id, $locale, $object = null) } if (!$entity instanceof TemplateInterface) { - throw new \RuntimeException(\sprintf('Expected to get "%s" from ContentResolver but "%s" given.', TemplateInterface::class, \get_class($entity))); + throw new \RuntimeException(\sprintf('Expected to get "%s" from ContentResolver but "%s" given.', TemplateInterface::class, $entity::class)); } try { @@ -156,7 +156,7 @@ protected function loadEntity(string $entityClass, string $id, string $locale): ); if (!$resolvedDimensionContent instanceof TemplateInterface) { - throw new \RuntimeException(\sprintf('Expected to get "%s" from ContentResolver but "%s" given.', TemplateInterface::class, \get_class($resolvedDimensionContent))); + throw new \RuntimeException(\sprintf('Expected to get "%s" from ContentResolver but "%s" given.', TemplateInterface::class, $resolvedDimensionContent::class)); } return $resolvedDimensionContent; diff --git a/Content/Infrastructure/Sulu/Search/ContentReindexProvider.php b/Content/Infrastructure/Sulu/Search/ContentReindexProvider.php index 3a97116e..0c1684f9 100644 --- a/Content/Infrastructure/Sulu/Search/ContentReindexProvider.php +++ b/Content/Infrastructure/Sulu/Search/ContentReindexProvider.php @@ -67,7 +67,7 @@ public function __construct( ContentMetadataInspectorInterface $contentMetadataInspector, ContentResolverInterface $contentResolver, string $context, - string $contentRichEntityClass + string $contentRichEntityClass, ) { $this->entityManager = $entityManager; $this->contentMetadataInspector = $contentMetadataInspector; diff --git a/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php b/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php index 10c03678..dc687ee5 100644 --- a/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php +++ b/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php @@ -83,7 +83,7 @@ public function __construct( ContentMetadataInspectorInterface $contentMetadataInspector, Factory $searchMetadataFactory, StructureMetadataFactoryInterface $structureFactory, - string $contentRichEntityClass + string $contentRichEntityClass, ) { $this->contentMetadataInspector = $contentMetadataInspector; $this->searchMetadataFactory = $searchMetadataFactory; diff --git a/Content/Infrastructure/Sulu/Sitemap/ContentSitemapProvider.php b/Content/Infrastructure/Sulu/Sitemap/ContentSitemapProvider.php index 234ae3eb..65aa9a24 100644 --- a/Content/Infrastructure/Sulu/Sitemap/ContentSitemapProvider.php +++ b/Content/Infrastructure/Sulu/Sitemap/ContentSitemapProvider.php @@ -86,7 +86,7 @@ public function __construct( string $kernelEnvironment, string $contentRichEntityClass, string $routeClass, - string $alias + string $alias, ) { $this->entityManager = $entityManager; $this->webspaceManager = $webspaceManager; @@ -241,7 +241,7 @@ protected function generateSitemapUrl( array $alternateRoutes, string $webspaceKey, string $host, - string $scheme + string $scheme, ): ?SitemapUrl { $url = $this->generateUrl($route, $webspaceKey, $host, $scheme); @@ -276,7 +276,7 @@ protected function generateUrl( RouteInterface $route, string $webspaceKey, string $host, - string $scheme + string $scheme, ): ?string { $url = $this->webspaceManager->findUrlByResourceLocator( $route->getPath(), diff --git a/Content/Infrastructure/Sulu/SmartContent/Provider/ContentDataProvider.php b/Content/Infrastructure/Sulu/SmartContent/Provider/ContentDataProvider.php index 705fb4c0..bd7dffe8 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/Content/Infrastructure/Sulu/SmartContent/Repository/ContentDataProviderRepository.php b/Content/Infrastructure/Sulu/SmartContent/Repository/ContentDataProviderRepository.php index 8e17be5f..4a5be0cf 100644 --- a/Content/Infrastructure/Sulu/SmartContent/Repository/ContentDataProviderRepository.php +++ b/Content/Infrastructure/Sulu/SmartContent/Repository/ContentDataProviderRepository.php @@ -63,7 +63,7 @@ public function __construct( ContentManagerInterface $contentManager, EntityManagerInterface $entityManager, bool $showDrafts, - string $contentRichEntityClass + string $contentRichEntityClass, ) { $this->contentManager = $contentManager; $this->entityManager = $entityManager; @@ -166,7 +166,7 @@ protected function findEntityIdsByFilters( ?int $pageSize, ?int $limit, string $locale, - array $options = [] + array $options = [], ): array { $parameters = []; @@ -393,7 +393,7 @@ protected function addDatasourceFilter(QueryBuilder $queryBuilder, string $datas protected function setSortBy( QueryBuilder $queryBuilder, string $sortColumn, - string $sortMethod + string $sortMethod, ): array { $parameters = []; diff --git a/Content/Infrastructure/Sulu/Structure/ContentStructureBridge.php b/Content/Infrastructure/Sulu/Structure/ContentStructureBridge.php index 5b0328f6..c54470bc 100644 --- a/Content/Infrastructure/Sulu/Structure/ContentStructureBridge.php +++ b/Content/Infrastructure/Sulu/Structure/ContentStructureBridge.php @@ -68,7 +68,7 @@ public function __construct( LegacyPropertyFactory $propertyFactory, TemplateInterface $content, $id, - string $locale + string $locale, ) { $this->structure = $structure; $this->propertyFactory = $propertyFactory; diff --git a/Content/Infrastructure/Sulu/Teaser/ContentTeaserProvider.php b/Content/Infrastructure/Sulu/Teaser/ContentTeaserProvider.php index bee1a301..3e2f78e0 100644 --- a/Content/Infrastructure/Sulu/Teaser/ContentTeaserProvider.php +++ b/Content/Infrastructure/Sulu/Teaser/ContentTeaserProvider.php @@ -79,7 +79,7 @@ public function __construct( ContentMetadataInspectorInterface $contentMetadataInspector, StructureMetadataFactoryInterface $metadataFactory, string $contentRichEntityClass, - bool $showDrafts + bool $showDrafts, ) { $this->contentManager = $contentManager; $this->entityManager = $entityManager; diff --git a/Tests/Application/ExampleTestBundle/Admin/ExampleAdmin.php b/Tests/Application/ExampleTestBundle/Admin/ExampleAdmin.php index 89303e1c..6cf8f706 100644 --- a/Tests/Application/ExampleTestBundle/Admin/ExampleAdmin.php +++ b/Tests/Application/ExampleTestBundle/Admin/ExampleAdmin.php @@ -59,7 +59,7 @@ public function __construct( ViewBuilderFactoryInterface $viewBuilderFactory, ContentViewBuilderFactoryInterface $contentViewBuilderFactory, SecurityCheckerInterface $securityChecker, - LocalizationManagerInterface $localizationManager + LocalizationManagerInterface $localizationManager, ) { $this->viewBuilderFactory = $viewBuilderFactory; $this->contentViewBuilderFactory = $contentViewBuilderFactory; diff --git a/Tests/Application/ExampleTestBundle/Controller/ExampleController.php b/Tests/Application/ExampleTestBundle/Controller/ExampleController.php index becf9a08..0ef4ebd3 100644 --- a/Tests/Application/ExampleTestBundle/Controller/ExampleController.php +++ b/Tests/Application/ExampleTestBundle/Controller/ExampleController.php @@ -76,7 +76,7 @@ public function __construct( RestHelperInterface $restHelper, ContentManagerInterface $contentManager, ContentIndexerInterface $contentIndexer, - EntityManagerInterface $entityManager + EntityManagerInterface $entityManager, ) { $this->fieldDescriptorFactory = $fieldDescriptorFactory; $this->listBuilderFactory = $listBuilderFactory; diff --git a/Tests/Application/ExampleTestBundle/Link/ExampleLinkProvider.php b/Tests/Application/ExampleTestBundle/Link/ExampleLinkProvider.php index 0ac9abed..c7094699 100644 --- a/Tests/Application/ExampleTestBundle/Link/ExampleLinkProvider.php +++ b/Tests/Application/ExampleTestBundle/Link/ExampleLinkProvider.php @@ -30,7 +30,7 @@ class ExampleLinkProvider extends ContentLinkProvider public function __construct( ContentManagerInterface $contentManager, StructureMetadataFactoryInterface $structureMetadataFactory, - EntityManagerInterface $entityManager + EntityManagerInterface $entityManager, ) { parent::__construct($contentManager, $structureMetadataFactory, $entityManager, Example::class); } diff --git a/Tests/Application/ExampleTestBundle/Repository/ExampleRepository.php b/Tests/Application/ExampleTestBundle/Repository/ExampleRepository.php index 795ccd0b..9879eb11 100644 --- a/Tests/Application/ExampleTestBundle/Repository/ExampleRepository.php +++ b/Tests/Application/ExampleTestBundle/Repository/ExampleRepository.php @@ -78,7 +78,7 @@ class ExampleRepository public function __construct( EntityManagerInterface $entityManager, - DimensionContentQueryEnhancer $dimensionContentQueryEnhancer + DimensionContentQueryEnhancer $dimensionContentQueryEnhancer, ) { $this->entityRepository = $entityManager->getRepository(Example::class); $this->entityManager = $entityManager; diff --git a/Tests/Application/ExampleTestBundle/Teaser/ExampleTeaserProvider.php b/Tests/Application/ExampleTestBundle/Teaser/ExampleTeaserProvider.php index 91edd459..6817a9d7 100644 --- a/Tests/Application/ExampleTestBundle/Teaser/ExampleTeaserProvider.php +++ b/Tests/Application/ExampleTestBundle/Teaser/ExampleTeaserProvider.php @@ -40,7 +40,7 @@ public function __construct( ContentMetadataInspectorInterface $contentMetadataInspector, StructureMetadataFactoryInterface $metadataFactory, TranslatorInterface $translator, - bool $showDrafts + bool $showDrafts, ) { parent::__construct($contentManager, $entityManager, $contentMetadataInspector, $metadataFactory, Example::class, $showDrafts); diff --git a/Tests/Functional/Content/Infrastructure/Sulu/Sitemap/ContentSitemapProviderTest.php b/Tests/Functional/Content/Infrastructure/Sulu/Sitemap/ContentSitemapProviderTest.php index 5b1a72a0..dbe76e9f 100644 --- a/Tests/Functional/Content/Infrastructure/Sulu/Sitemap/ContentSitemapProviderTest.php +++ b/Tests/Functional/Content/Infrastructure/Sulu/Sitemap/ContentSitemapProviderTest.php @@ -146,7 +146,7 @@ public function testCreateSitemap(): void $sitemap = $this->contentSitemapProvider->createSitemap(static::SCHEME, static::HOST); $this->assertNotNull($sitemap); - $this->assertSame(Sitemap::class, \get_class($sitemap)); + $this->assertSame(Sitemap::class, $sitemap::class); $this->assertSame($this->contentSitemapProvider->getAlias(), $sitemap->getAlias()); $this->assertSame($this->contentSitemapProvider->getMaxPage(static::SCHEME, static::HOST), $sitemap->getMaxPage()); } diff --git a/Tests/Traits/AssertSnapshotTrait.php b/Tests/Traits/AssertSnapshotTrait.php index 2755d265..5365d7fc 100644 --- a/Tests/Traits/AssertSnapshotTrait.php +++ b/Tests/Traits/AssertSnapshotTrait.php @@ -27,7 +27,7 @@ protected function assertResponseSnapshot( string $snapshotPatternFilename, $actualResponse, int $statusCode = 200, - string $message = '' + string $message = '', ): void { $this->assertInstanceOf(Response::class, $actualResponse); $responseContent = $actualResponse->getContent(); @@ -43,7 +43,7 @@ protected function assertResponseSnapshot( protected function assertArraySnapshot( string $snapshotPatternFilename, array $array, - string $message = '' + string $message = '', ): void { $arrayContent = \json_encode($array); $this->assertIsString($arrayContent); @@ -54,7 +54,7 @@ protected function assertArraySnapshot( protected function assertSnapshot( string $snapshotPatternFilename, string $content, - string $message = '' + string $message = '', ): void { $snapshotFolder = $this->getCalledClassFolder() . \DIRECTORY_SEPARATOR . $this->getSnapshotFolder(); $snapshotPattern = \file_get_contents($snapshotFolder . \DIRECTORY_SEPARATOR . $snapshotPatternFilename); diff --git a/Tests/Traits/CreateExampleTrait.php b/Tests/Traits/CreateExampleTrait.php index 29ac19c7..8b9ba0a7 100644 --- a/Tests/Traits/CreateExampleTrait.php +++ b/Tests/Traits/CreateExampleTrait.php @@ -152,7 +152,7 @@ protected static function createExample(array $dataSet = [], array $options = [] $draftTemplateData = $draftLocalizedDimension->getTemplateData(); $route->setPath($draftTemplateData['url']); $route->setEntityId($example->getId()); // @phpstan-ignore-line - $route->setEntityClass(\get_class($example)); + $route->setEntityClass($example::class); $entityManager->persist($route); } diff --git a/Tests/Unit/Content/Application/ContentCopier/ContentCopierTest.php b/Tests/Unit/Content/Application/ContentCopier/ContentCopierTest.php index fd1b3f37..32721b6f 100644 --- a/Tests/Unit/Content/Application/ContentCopier/ContentCopierTest.php +++ b/Tests/Unit/Content/Application/ContentCopier/ContentCopierTest.php @@ -33,7 +33,7 @@ protected function createContentCopierInstance( ContentResolverInterface $contentResolver, ContentMergerInterface $contentMerger, ContentPersisterInterface $contentPersister, - ContentNormalizerInterface $contentNormalizer + ContentNormalizerInterface $contentNormalizer, ): ContentCopierInterface { return new ContentCopier( $contentResolver, diff --git a/Tests/Unit/Content/Application/ContentDataMapper/ContentDataMapperTest.php b/Tests/Unit/Content/Application/ContentDataMapper/ContentDataMapperTest.php index bff6184b..ab7c36e9 100644 --- a/Tests/Unit/Content/Application/ContentDataMapper/ContentDataMapperTest.php +++ b/Tests/Unit/Content/Application/ContentDataMapper/ContentDataMapperTest.php @@ -28,7 +28,7 @@ class ContentDataMapperTest extends TestCase * @param iterable $dataMappers */ protected function createContentDataMapperInstance( - iterable $dataMappers + iterable $dataMappers, ): ContentDataMapperInterface { return new ContentDataMapper($dataMappers); } diff --git a/Tests/Unit/Content/Application/ContentDataMapper/DataMapper/RoutableDataMapperTest.php b/Tests/Unit/Content/Application/ContentDataMapper/DataMapper/RoutableDataMapperTest.php index b9b07bca..a5225ae3 100644 --- a/Tests/Unit/Content/Application/ContentDataMapper/DataMapper/RoutableDataMapperTest.php +++ b/Tests/Unit/Content/Application/ContentDataMapper/DataMapper/RoutableDataMapperTest.php @@ -68,7 +68,7 @@ protected function setUp(): void * @param array> $resourceKeyMappings */ protected function createRouteDataMapperInstance( - ?array $resourceKeyMappings = null + ?array $resourceKeyMappings = null, ): RoutableDataMapper { if (!\is_array($resourceKeyMappings)) { $resourceKeyMappings = [ diff --git a/Tests/Unit/Content/Application/ContentDataMapper/DataMapper/TemplateDataMapperTest.php b/Tests/Unit/Content/Application/ContentDataMapper/DataMapper/TemplateDataMapperTest.php index f37cdf6d..ee3c37bb 100644 --- a/Tests/Unit/Content/Application/ContentDataMapper/DataMapper/TemplateDataMapperTest.php +++ b/Tests/Unit/Content/Application/ContentDataMapper/DataMapper/TemplateDataMapperTest.php @@ -42,7 +42,7 @@ protected function setUp(): void * @param array $structureDefaultTypes */ protected function createTemplateDataMapperInstance( - array $structureDefaultTypes = [] + array $structureDefaultTypes = [], ): TemplateDataMapper { return new TemplateDataMapper($this->structureMetadataFactory->reveal(), $structureDefaultTypes); } diff --git a/Tests/Unit/Content/Application/ContentIndexer/ContentIndexerTest.php b/Tests/Unit/Content/Application/ContentIndexer/ContentIndexerTest.php index 03def389..20fa79b6 100644 --- a/Tests/Unit/Content/Application/ContentIndexer/ContentIndexerTest.php +++ b/Tests/Unit/Content/Application/ContentIndexer/ContentIndexerTest.php @@ -33,7 +33,7 @@ class ContentIndexerTest extends TestCase protected function createContentIndexerInstance( SearchManagerInterface $searchManager, - ContentResolverInterface $contentResolver + ContentResolverInterface $contentResolver, ): ContentIndexerInterface { /** @var SearchManager $searchManager */ diff --git a/Tests/Unit/Content/Application/ContentManager/ContentManagerTest.php b/Tests/Unit/Content/Application/ContentManager/ContentManagerTest.php index a7b986e7..7678b20c 100644 --- a/Tests/Unit/Content/Application/ContentManager/ContentManagerTest.php +++ b/Tests/Unit/Content/Application/ContentManager/ContentManagerTest.php @@ -35,7 +35,7 @@ protected function createContentManagerInstance( ContentNormalizerInterface $contentNormalizer, ContentCopierInterface $contentCopier, ContentWorkflowInterface $contentWorkflow, - ContentIndexerInterface $contentIndexer + ContentIndexerInterface $contentIndexer, ): ContentManagerInterface { return new ContentManager( $contentResolver, diff --git a/Tests/Unit/Content/Application/ContentMerger/ContentMergerTest.php b/Tests/Unit/Content/Application/ContentMerger/ContentMergerTest.php index fe155296..d03a5dfb 100644 --- a/Tests/Unit/Content/Application/ContentMerger/ContentMergerTest.php +++ b/Tests/Unit/Content/Application/ContentMerger/ContentMergerTest.php @@ -30,7 +30,7 @@ class ContentMergerTest extends TestCase * @param iterable $mergers */ protected function createContentMergerInstance( - iterable $mergers + iterable $mergers, ): ContentMergerInterface { return new ContentMerger($mergers, new PropertyAccessor()); } @@ -79,7 +79,7 @@ public function testMerge(): void ], [ 'locale' => 'en', 'stage' => 'draft', - ], \get_class($dimensionContent1)); + ], $dimensionContent1::class); $this->assertSame( $mergedDimensionContent->reveal(), diff --git a/Tests/Unit/Content/Application/ContentMetadataInspector/ContentMetadataInspectorTest.php b/Tests/Unit/Content/Application/ContentMetadataInspector/ContentMetadataInspectorTest.php index 099817f9..810eaec0 100644 --- a/Tests/Unit/Content/Application/ContentMetadataInspector/ContentMetadataInspectorTest.php +++ b/Tests/Unit/Content/Application/ContentMetadataInspector/ContentMetadataInspectorTest.php @@ -26,7 +26,7 @@ class ContentMetadataInspectorTest extends TestCase use \Prophecy\PhpUnit\ProphecyTrait; protected function createContentMetadataInspectorTestInstance( - EntityManagerInterface $entityManager + EntityManagerInterface $entityManager, ): ContentMetadataInspectorInterface { return new ContentMetadataInspector( $entityManager diff --git a/Tests/Unit/Content/Application/ContentPersister/ContentPersisterTest.php b/Tests/Unit/Content/Application/ContentPersister/ContentPersisterTest.php index 003e236f..06df2b09 100644 --- a/Tests/Unit/Content/Application/ContentPersister/ContentPersisterTest.php +++ b/Tests/Unit/Content/Application/ContentPersister/ContentPersisterTest.php @@ -29,7 +29,7 @@ class ContentPersisterTest extends TestCase protected function createContentPersisterInstance( DimensionContentCollectionFactoryInterface $dimensionContentCollectionFactory, - ContentMergerInterface $contentMerger + ContentMergerInterface $contentMerger, ): ContentPersisterInterface { return new ContentPersister( $dimensionContentCollectionFactory, diff --git a/Tests/Unit/Content/Application/ContentResolver/ContentResolverTest.php b/Tests/Unit/Content/Application/ContentResolver/ContentResolverTest.php index e549390d..a9d49482 100644 --- a/Tests/Unit/Content/Application/ContentResolver/ContentResolverTest.php +++ b/Tests/Unit/Content/Application/ContentResolver/ContentResolverTest.php @@ -31,7 +31,7 @@ class ContentResolverTest extends TestCase protected function createContentResolverInstance( DimensionContentRepositoryInterface $dimensionContentRepository, - ContentMergerInterface $contentMerger + ContentMergerInterface $contentMerger, ): ContentResolverInterface { return new ContentResolver( $dimensionContentRepository, diff --git a/Tests/Unit/Content/Application/ContentWorkflow/ContentWorkflowTest.php b/Tests/Unit/Content/Application/ContentWorkflow/ContentWorkflowTest.php index 99c9aa30..cef69aa8 100644 --- a/Tests/Unit/Content/Application/ContentWorkflow/ContentWorkflowTest.php +++ b/Tests/Unit/Content/Application/ContentWorkflow/ContentWorkflowTest.php @@ -38,7 +38,7 @@ class ContentWorkflowTest extends TestCase protected function createContentWorkflowInstance( DimensionContentRepositoryInterface $dimensionContentRepository, - ContentMergerInterface $contentMerger + ContentMergerInterface $contentMerger, ): ContentWorkflowInterface { return new ContentWorkflow( $dimensionContentRepository, @@ -207,7 +207,7 @@ public function testNotExistTransition(): void public function testTransitions( string $currentPlace, string $transitionName, - bool $isTransitionAllowed + bool $isTransitionAllowed, ): void { if (!$isTransitionAllowed) { $this->expectException(UnavailableContentTransitionException::class); diff --git a/Tests/Unit/Content/Application/ContentWorkflow/Subscriber/PublishTransitionSubscriberTest.php b/Tests/Unit/Content/Application/ContentWorkflow/Subscriber/PublishTransitionSubscriberTest.php index f734908e..89ff8f4f 100644 --- a/Tests/Unit/Content/Application/ContentWorkflow/Subscriber/PublishTransitionSubscriberTest.php +++ b/Tests/Unit/Content/Application/ContentWorkflow/Subscriber/PublishTransitionSubscriberTest.php @@ -33,7 +33,7 @@ class PublishTransitionSubscriberTest extends TestCase use ProphecyTrait; public function createContentPublisherSubscriberInstance( - ContentCopierInterface $contentCopier + ContentCopierInterface $contentCopier, ): PublishTransitionSubscriber { return new PublishTransitionSubscriber($contentCopier); } diff --git a/Tests/Unit/Content/Application/ContentWorkflow/Subscriber/RemoveDraftTransitionSubscriberTest.php b/Tests/Unit/Content/Application/ContentWorkflow/Subscriber/RemoveDraftTransitionSubscriberTest.php index 6dc8717b..1cd97d48 100644 --- a/Tests/Unit/Content/Application/ContentWorkflow/Subscriber/RemoveDraftTransitionSubscriberTest.php +++ b/Tests/Unit/Content/Application/ContentWorkflow/Subscriber/RemoveDraftTransitionSubscriberTest.php @@ -29,7 +29,7 @@ class RemoveDraftTransitionSubscriberTest extends TestCase use \Prophecy\PhpUnit\ProphecyTrait; public function createContentRemoveDraftSubscriberInstance( - ContentCopierInterface $contentCopier + ContentCopierInterface $contentCopier, ): RemoveDraftTransitionSubscriber { return new RemoveDraftTransitionSubscriber($contentCopier); } diff --git a/Tests/Unit/Content/Application/ContentWorkflow/Subscriber/UnpublishTransitionSubscriberTest.php b/Tests/Unit/Content/Application/ContentWorkflow/Subscriber/UnpublishTransitionSubscriberTest.php index e7cdc0b4..2a116fd7 100644 --- a/Tests/Unit/Content/Application/ContentWorkflow/Subscriber/UnpublishTransitionSubscriberTest.php +++ b/Tests/Unit/Content/Application/ContentWorkflow/Subscriber/UnpublishTransitionSubscriberTest.php @@ -35,7 +35,7 @@ class UnpublishTransitionSubscriberTest extends TestCase public function createContentUnpublishSubscriberInstance( DimensionContentRepositoryInterface $dimensionContentRepository, - EntityManagerInterface $entityManager + EntityManagerInterface $entityManager, ): UnpublishTransitionSubscriber { return new UnpublishTransitionSubscriber($dimensionContentRepository, $entityManager); } diff --git a/Tests/Unit/Content/Application/DimensionContentCollectionFactory/DimensionContentCollectionFactoryTest.php b/Tests/Unit/Content/Application/DimensionContentCollectionFactory/DimensionContentCollectionFactoryTest.php index 8eeb7772..550d5a14 100644 --- a/Tests/Unit/Content/Application/DimensionContentCollectionFactory/DimensionContentCollectionFactoryTest.php +++ b/Tests/Unit/Content/Application/DimensionContentCollectionFactory/DimensionContentCollectionFactoryTest.php @@ -39,7 +39,7 @@ class DimensionContentCollectionFactoryTest extends TestCase protected function createDimensionContentCollectionFactoryInstance( array $dimensionAttributes, array $existDimensionContents, - ContentDataMapperInterface $contentDataMapper + ContentDataMapperInterface $contentDataMapper, ): DimensionContentCollectionFactory { $dimensionContentRepository = $this->prophesize(DimensionContentRepositoryInterface::class); $dimensionContentRepository->load(Argument::any(), Argument::any())->willReturn( diff --git a/Tests/Unit/Content/Domain/Model/DimensionContentCollectionTest.php b/Tests/Unit/Content/Domain/Model/DimensionContentCollectionTest.php index 6377a1fa..5569df74 100644 --- a/Tests/Unit/Content/Domain/Model/DimensionContentCollectionTest.php +++ b/Tests/Unit/Content/Domain/Model/DimensionContentCollectionTest.php @@ -29,7 +29,7 @@ class DimensionContentCollectionTest extends TestCase */ protected function createDimensionContentCollectionInstance( array $dimensionContents, - array $dimensionAttributes + array $dimensionAttributes, ): DimensionContentCollectionInterface { return new DimensionContentCollection($dimensionContents, $dimensionAttributes, ExampleDimensionContent::class); } diff --git a/Tests/Unit/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactoryTest.php b/Tests/Unit/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactoryTest.php index 6dac5be1..50b658cf 100644 --- a/Tests/Unit/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactoryTest.php +++ b/Tests/Unit/Content/Infrastructure/Sulu/Admin/ContentViewBuilderFactoryTest.php @@ -56,7 +56,7 @@ protected function createContentViewBuilder( ContentMetadataInspectorInterface $contentMetadataInspector, SecurityCheckerInterface $securityChecker, ?PreviewObjectProviderRegistryInterface $previewObjectProviderRegistry = null, - array $settingsForms = [] + array $settingsForms = [], ): ContentViewBuilderFactoryInterface { if (null === $previewObjectProviderRegistry) { $previewObjectProviderRegistry = $this->createPreviewObjectProviderRegistry([]); @@ -91,7 +91,7 @@ protected function createContentObjectProvider( EntityManagerInterface $entityManager, ContentResolverInterface $contentResolver, ContentDataMapperInterface $contentDataMapper, - string $entityClass + string $entityClass, ): ContentObjectProvider { return new ContentObjectProvider( $entityManager, @@ -446,7 +446,7 @@ public function testCreateViewsWithContentRichEntityClass(DimensionContentInterf $contentMetadataInspector = $this->prophesize(ContentMetadataInspectorInterface::class); $contentMetadataInspector->getDimensionContentClass(Example::class) - ->willReturn(\get_class($dimensionContentObject)); + ->willReturn($dimensionContentObject::class); $contentViewBuilder = $this->createContentViewBuilder($contentMetadataInspector->reveal(), $securityChecker->reveal()); diff --git a/Tests/Unit/Content/Infrastructure/Sulu/Automation/ContentPublishTaskHandlerTest.php b/Tests/Unit/Content/Infrastructure/Sulu/Automation/ContentPublishTaskHandlerTest.php index d29d1984..65e68126 100644 --- a/Tests/Unit/Content/Infrastructure/Sulu/Automation/ContentPublishTaskHandlerTest.php +++ b/Tests/Unit/Content/Infrastructure/Sulu/Automation/ContentPublishTaskHandlerTest.php @@ -112,7 +112,7 @@ public function testSupports(): void { $entity = new Example(); - $this->assertTrue($this->handler->supports(\get_class($entity))); + $this->assertTrue($this->handler->supports($entity::class)); $this->assertFalse($this->handler->supports(PageDocument::class)); } diff --git a/Tests/Unit/Content/Infrastructure/Sulu/Automation/ContentUnpublishTaskHandlerTest.php b/Tests/Unit/Content/Infrastructure/Sulu/Automation/ContentUnpublishTaskHandlerTest.php index dc0c08ad..66a8c87c 100644 --- a/Tests/Unit/Content/Infrastructure/Sulu/Automation/ContentUnpublishTaskHandlerTest.php +++ b/Tests/Unit/Content/Infrastructure/Sulu/Automation/ContentUnpublishTaskHandlerTest.php @@ -112,7 +112,7 @@ public function testSupports(): void { $entity = new Example(); - $this->assertTrue($this->handler->supports(\get_class($entity))); + $this->assertTrue($this->handler->supports($entity::class)); $this->assertFalse($this->handler->supports(PageDocument::class)); } diff --git a/Tests/Unit/Content/Infrastructure/Sulu/Preview/ContentObjectProviderTest.php b/Tests/Unit/Content/Infrastructure/Sulu/Preview/ContentObjectProviderTest.php index a5b46ae0..9b46c3df 100644 --- a/Tests/Unit/Content/Infrastructure/Sulu/Preview/ContentObjectProviderTest.php +++ b/Tests/Unit/Content/Infrastructure/Sulu/Preview/ContentObjectProviderTest.php @@ -255,7 +255,7 @@ public function testSetValues( 'excerptCategories' => [1, 2], 'excerptImage' => ['id' => 3], 'excerptIcon' => ['id' => 4], - ] + ], ): void { $example = new Example(); $exampleDimensionContent = new ExampleDimensionContent($example); diff --git a/Tests/Unit/Content/Infrastructure/Sulu/Preview/PreviewDimensionContentCollectionTest.php b/Tests/Unit/Content/Infrastructure/Sulu/Preview/PreviewDimensionContentCollectionTest.php index 70989271..14903525 100644 --- a/Tests/Unit/Content/Infrastructure/Sulu/Preview/PreviewDimensionContentCollectionTest.php +++ b/Tests/Unit/Content/Infrastructure/Sulu/Preview/PreviewDimensionContentCollectionTest.php @@ -29,7 +29,7 @@ class PreviewDimensionContentCollectionTest extends TestCase */ protected function createPreviewDimensionContentCollection( ?ExampleDimensionContent $previewDimensionContent = null, - string $locale = 'en' + string $locale = 'en', ): PreviewDimensionContentCollection { return new PreviewDimensionContentCollection( $previewDimensionContent ?: new ExampleDimensionContent(new Example()), diff --git a/Tests/Unit/Content/Infrastructure/Sulu/Route/ContentRouteDefaultsProviderTest.php b/Tests/Unit/Content/Infrastructure/Sulu/Route/ContentRouteDefaultsProviderTest.php index 1197cc4c..03214015 100644 --- a/Tests/Unit/Content/Infrastructure/Sulu/Route/ContentRouteDefaultsProviderTest.php +++ b/Tests/Unit/Content/Infrastructure/Sulu/Route/ContentRouteDefaultsProviderTest.php @@ -41,7 +41,7 @@ protected function getContentRouteDefaultsProvider( EntityManagerInterface $entityManager, ContentResolverInterface $contentResolver, ContentStructureBridgeFactory $contentStructureBridgeFactory, - CacheLifetimeResolverInterface $cacheLifetimeResolver + CacheLifetimeResolverInterface $cacheLifetimeResolver, ): ContentRouteDefaultsProvider { return new ContentRouteDefaultsProvider( $entityManager, @@ -67,7 +67,7 @@ public function testSupports(): void $contentRichEntity = new Example(); - $this->assertTrue($contentRouteDefaultsProvider->supports(\get_class($contentRichEntity))); + $this->assertTrue($contentRouteDefaultsProvider->supports($contentRichEntity::class)); $this->assertFalse($contentRouteDefaultsProvider->supports(\stdClass::class)); } diff --git a/Tests/Unit/Content/Infrastructure/Sulu/SmartContent/DataItem/ContentDataItemTest.php b/Tests/Unit/Content/Infrastructure/Sulu/SmartContent/DataItem/ContentDataItemTest.php index 35d850f7..362a2411 100644 --- a/Tests/Unit/Content/Infrastructure/Sulu/SmartContent/DataItem/ContentDataItemTest.php +++ b/Tests/Unit/Content/Infrastructure/Sulu/SmartContent/DataItem/ContentDataItemTest.php @@ -38,7 +38,7 @@ class ContentDataItemTest extends TestCase */ protected function getContentDataItem( DimensionContentInterface $dimensionContent, - array $data + array $data, ): ContentDataItem { return new ContentDataItem($dimensionContent, $data); } diff --git a/Tests/Unit/Content/Infrastructure/Sulu/Structure/ContentDocumentTest.php b/Tests/Unit/Content/Infrastructure/Sulu/Structure/ContentDocumentTest.php index 7b5fcd80..94ce04df 100644 --- a/Tests/Unit/Content/Infrastructure/Sulu/Structure/ContentDocumentTest.php +++ b/Tests/Unit/Content/Infrastructure/Sulu/Structure/ContentDocumentTest.php @@ -26,7 +26,7 @@ class ContentDocumentTest extends TestCase protected function createContentDocument( ?TemplateInterface $content = null, - string $locale = 'en' + string $locale = 'en', ): ContentDocument { return new ContentDocument( $content ?: $this->prophesize(TemplateInterface::class)->reveal(), $locale diff --git a/Tests/Unit/Content/Infrastructure/Sulu/Structure/ContentStructureBridgeFactoryTest.php b/Tests/Unit/Content/Infrastructure/Sulu/Structure/ContentStructureBridgeFactoryTest.php index 173df37f..5fd7d7a1 100644 --- a/Tests/Unit/Content/Infrastructure/Sulu/Structure/ContentStructureBridgeFactoryTest.php +++ b/Tests/Unit/Content/Infrastructure/Sulu/Structure/ContentStructureBridgeFactoryTest.php @@ -31,7 +31,7 @@ class ContentStructureBridgeFactoryTest extends TestCase protected function getContentStructureBridgeFactory( StructureMetadataFactoryInterface $structureMetadataFactory, - LegacyPropertyFactory $propertyFactory + LegacyPropertyFactory $propertyFactory, ): ContentStructureBridgeFactory { return new ContentStructureBridgeFactory( $structureMetadataFactory, $propertyFactory diff --git a/Tests/Unit/Content/Infrastructure/Sulu/Structure/ContentStructureBridgeTest.php b/Tests/Unit/Content/Infrastructure/Sulu/Structure/ContentStructureBridgeTest.php index 087055cb..34645d63 100644 --- a/Tests/Unit/Content/Infrastructure/Sulu/Structure/ContentStructureBridgeTest.php +++ b/Tests/Unit/Content/Infrastructure/Sulu/Structure/ContentStructureBridgeTest.php @@ -39,7 +39,7 @@ protected function createStructureBridge( ?StructureMetadata $structure = null, ?LegacyPropertyFactory $propertyFactory = null, string $id = '123-123-123', - string $locale = 'en' + string $locale = 'en', ): ContentStructureBridge { return new ContentStructureBridge( $structure ?: $this->prophesize(StructureMetadata::class)->reveal(),