diff --git a/ecs.php b/ecs.php index 5afd1003..525fa8d9 100644 --- a/ecs.php +++ b/ecs.php @@ -1,6 +1,7 @@ set( NativeFunctionInvocationFixer::class )->call('configure', [['include' => ['@all'], 'scope' => 'all', 'strict' => \true]]); + $services->set( + TrailingCommaInMultilineFixer::class + )->call('configure', [['elements' => ['arrays']]]); }; diff --git a/spec/Builder/SitemapBuilderSpec.php b/spec/Builder/SitemapBuilderSpec.php index 97e69fc2..a2c4ef02 100644 --- a/spec/Builder/SitemapBuilderSpec.php +++ b/spec/Builder/SitemapBuilderSpec.php @@ -35,7 +35,7 @@ function it_builds_sitemap( UrlProviderInterface $productUrlProvider, SitemapInterface $sitemap, UrlInterface $bookUrl, - ChannelInterface $channel, + ChannelInterface $channel ): void { $sitemapFactory->createNew()->willReturn($sitemap); $this->addProvider($productUrlProvider); diff --git a/spec/Model/SitemapSpec.php b/spec/Model/SitemapSpec.php index 57cf3a37..364f729c 100644 --- a/spec/Model/SitemapSpec.php +++ b/spec/Model/SitemapSpec.php @@ -37,7 +37,7 @@ function it_adds_url(UrlInterface $sitemapUrl): void function it_removes_url( UrlInterface $sitemapUrl, UrlInterface $productUrl, - UrlInterface $staticUrl, + UrlInterface $staticUrl ): void { $this->addUrl($sitemapUrl); $this->addUrl($staticUrl); @@ -61,7 +61,7 @@ function it_has_last_modification_date(\DateTime $now): void function it_throws_sitemap_url_not_found_exception_if_cannot_find_url_to_remove( UrlInterface $productUrl, - UrlInterface $staticUrl, + UrlInterface $staticUrl ): void { $this->addUrl($productUrl); diff --git a/spec/Provider/ProductUrlProviderSpec.php b/spec/Provider/ProductUrlProviderSpec.php index 2ad55d0a..b011654a 100644 --- a/spec/Provider/ProductUrlProviderSpec.php +++ b/spec/Provider/ProductUrlProviderSpec.php @@ -34,7 +34,7 @@ function let( UrlFactoryInterface $urlFactory, AlternativeUrlFactoryInterface $alternativeUrlFactory, LocaleContextInterface $localeContext, - ProductImagesToSitemapImagesCollectionGeneratorInterface $productToImageSitemapArrayGenerator, + ProductImagesToSitemapImagesCollectionGeneratorInterface $productToImageSitemapArrayGenerator ): void { $this->beConstructedWith($repository, $router, $urlFactory, $alternativeUrlFactory, $localeContext, $productToImageSitemapArrayGenerator); } @@ -67,7 +67,7 @@ function it_generates_urls_for_the_unique_channel_locale( QueryBuilder $queryBuilder, AbstractQuery $query, ChannelInterface $channel, - ProductImagesToSitemapImagesCollectionGeneratorInterface $productToImageSitemapArrayGenerator, + ProductImagesToSitemapImagesCollectionGeneratorInterface $productToImageSitemapArrayGenerator ): void { $now = new \DateTime(); @@ -157,7 +157,7 @@ function it_generates_urls_for_all_channel_locales( QueryBuilder $queryBuilder, AbstractQuery $query, ChannelInterface $channel, - ProductImagesToSitemapImagesCollectionGeneratorInterface $productToImageSitemapArrayGenerator, + ProductImagesToSitemapImagesCollectionGeneratorInterface $productToImageSitemapArrayGenerator ): void { $now = new \DateTime(); diff --git a/src/Command/GenerateSitemapCommand.php b/src/Command/GenerateSitemapCommand.php index 4ab77709..f01c0ba8 100644 --- a/src/Command/GenerateSitemapCommand.php +++ b/src/Command/GenerateSitemapCommand.php @@ -39,7 +39,7 @@ public function __construct( SitemapIndexBuilderInterface $sitemapIndexBuilder, Writer $writer, ChannelRepositoryInterface $channelRepository, - RouterInterface $router, + RouterInterface $router ) { $this->sitemapRenderer = $sitemapRenderer; $this->sitemapIndexRenderer = $sitemapIndexRenderer; @@ -81,7 +81,7 @@ private function executeChannel(ChannelInterface $channel, OutputInterface $outp $this->writer->write( $path, - $xml, + $xml ); $output->writeln(\sprintf('Finished generating sitemap "%s" for channel "%s" at path "%s"', $provider->getName(), $channel->getCode(), $path)); @@ -95,7 +95,7 @@ private function executeChannel(ChannelInterface $channel, OutputInterface $outp $this->writer->write( $path, - $xml, + $xml ); $output->writeln(\sprintf('Finished generating sitemap index for channel "%s" at path "%s"', $channel->getCode(), $path)); diff --git a/src/Controller/SitemapController.php b/src/Controller/SitemapController.php index ac860358..af6d7632 100644 --- a/src/Controller/SitemapController.php +++ b/src/Controller/SitemapController.php @@ -14,7 +14,7 @@ final class SitemapController extends AbstractController public function __construct( ChannelContextInterface $channelContext, - Reader $reader, + Reader $reader ) { $this->channelContext = $channelContext; diff --git a/src/Controller/SitemapIndexController.php b/src/Controller/SitemapIndexController.php index 69bfa885..550078fe 100644 --- a/src/Controller/SitemapIndexController.php +++ b/src/Controller/SitemapIndexController.php @@ -14,7 +14,7 @@ final class SitemapIndexController extends AbstractController public function __construct( ChannelContextInterface $channelContext, - Reader $reader, + Reader $reader ) { $this->channelContext = $channelContext; diff --git a/src/Generator/ProductImagesToSitemapImagesCollectionGenerator.php b/src/Generator/ProductImagesToSitemapImagesCollectionGenerator.php index 29a70cd9..d286aa3e 100644 --- a/src/Generator/ProductImagesToSitemapImagesCollectionGenerator.php +++ b/src/Generator/ProductImagesToSitemapImagesCollectionGenerator.php @@ -22,7 +22,7 @@ final class ProductImagesToSitemapImagesCollectionGenerator implements ProductIm public function __construct( ImageFactoryInterface $sitemapImageUrlFactory, CacheManager $imagineCacheManager, - ?string $imagePreset = null, + ?string $imagePreset = null ) { $this->sitemapImageUrlFactory = $sitemapImageUrlFactory; $this->imagineCacheManager = $imagineCacheManager; diff --git a/src/Model/Url.php b/src/Model/Url.php index 11a93b33..6269227c 100644 --- a/src/Model/Url.php +++ b/src/Model/Url.php @@ -71,7 +71,7 @@ public function setPriority(float $priority): void if (0 > $priority || 1 < $priority) { throw new \InvalidArgumentException(\sprintf( 'The value %s is not supported by the option priority, it must be a number between 0.0 and 1.0.', - $priority, + $priority )); } diff --git a/src/Provider/IndexUrlProvider.php b/src/Provider/IndexUrlProvider.php index c6f27f66..d79970e9 100644 --- a/src/Provider/IndexUrlProvider.php +++ b/src/Provider/IndexUrlProvider.php @@ -18,7 +18,7 @@ final class IndexUrlProvider implements IndexUrlProviderInterface public function __construct( RouterInterface $router, - IndexUrlFactoryInterface $sitemapIndexUrlFactory, + IndexUrlFactoryInterface $sitemapIndexUrlFactory ) { $this->router = $router; $this->sitemapIndexUrlFactory = $sitemapIndexUrlFactory; diff --git a/src/Provider/ProductUrlProvider.php b/src/Provider/ProductUrlProvider.php index 20a9f11f..bb2f2ea9 100644 --- a/src/Provider/ProductUrlProvider.php +++ b/src/Provider/ProductUrlProvider.php @@ -44,7 +44,7 @@ public function __construct( UrlFactoryInterface $urlFactory, AlternativeUrlFactoryInterface $urlAlternativeFactory, LocaleContextInterface $localeContext, - ProductImagesToSitemapImagesCollectionGeneratorInterface $productToImageSitemapArrayGenerator, + ProductImagesToSitemapImagesCollectionGeneratorInterface $productToImageSitemapArrayGenerator ) { $this->productRepository = $productRepository; $this->router = $router; diff --git a/src/Provider/StaticUrlProvider.php b/src/Provider/StaticUrlProvider.php index fff1c773..47d6b62c 100644 --- a/src/Provider/StaticUrlProvider.php +++ b/src/Provider/StaticUrlProvider.php @@ -27,7 +27,7 @@ public function __construct( RouterInterface $router, UrlFactoryInterface $sitemapUrlFactory, AlternativeUrlFactoryInterface $urlAlternativeFactory, - array $routes, + array $routes ) { $this->router = $router; $this->sitemapUrlFactory = $sitemapUrlFactory; diff --git a/src/Provider/TaxonUrlProvider.php b/src/Provider/TaxonUrlProvider.php index d6242b36..70ca10f3 100644 --- a/src/Provider/TaxonUrlProvider.php +++ b/src/Provider/TaxonUrlProvider.php @@ -34,7 +34,7 @@ public function __construct( UrlFactoryInterface $sitemapUrlFactory, AlternativeUrlFactoryInterface $urlAlternativeFactory, LocaleContextInterface $localeContext, - bool $excludeTaxonRoot = true, + bool $excludeTaxonRoot = true ) { $this->taxonRepository = $taxonRepository; $this->router = $router; diff --git a/src/Routing/SitemapLoader.php b/src/Routing/SitemapLoader.php index 808b85e0..e81a8933 100644 --- a/src/Routing/SitemapLoader.php +++ b/src/Routing/SitemapLoader.php @@ -51,8 +51,8 @@ public function load($resource, $type = null) [], '', [], - ['GET'], - ), + ['GET'] + ) ); } diff --git a/tests/DependencyInjection/Compiler/SitemapParameterTest.php b/tests/DependencyInjection/Compiler/SitemapParameterTest.php index 43df8f3e..fe749dff 100644 --- a/tests/DependencyInjection/Compiler/SitemapParameterTest.php +++ b/tests/DependencyInjection/Compiler/SitemapParameterTest.php @@ -18,7 +18,7 @@ public function it_has_providers_enabled_by_default_with_parameter( array $config, bool $products, bool $taxons, - bool $static, + bool $static ) { $this->load($config); diff --git a/tests/DependencyInjection/Compiler/SitemapProviderPassTest.php b/tests/DependencyInjection/Compiler/SitemapProviderPassTest.php index 8e3d5309..ba2028b7 100644 --- a/tests/DependencyInjection/Compiler/SitemapProviderPassTest.php +++ b/tests/DependencyInjection/Compiler/SitemapProviderPassTest.php @@ -43,7 +43,7 @@ public function it_adds_method_call_to_sitemap_builder_if_providers_exist() 'addProvider', [ new Reference('sylius.sitemap_provider.product'), - ], + ] ); $this->assertContainerBuilderHasServiceDefinitionWithMethodCall( @@ -51,7 +51,7 @@ public function it_adds_method_call_to_sitemap_builder_if_providers_exist() 'addIndexProvider', [ new Reference('sylius.sitemap_index_provider.index'), - ], + ] ); } @@ -70,12 +70,12 @@ public function it_does_not_add_method_call_if_there_is_no_url_providers() $this->assertContainerBuilderDoesNotHaveServiceDefinitionWithMethodCall( 'sylius.sitemap_builder', - 'addProvider', + 'addProvider' ); $this->assertContainerBuilderDoesNotHaveServiceDefinitionWithMethodCall( 'sylius.sitemap_index_builder', - 'addProvider', + 'addProvider' ); } @@ -94,7 +94,7 @@ private function assertContainerBuilderDoesNotHaveServiceDefinitionWithMethodCal self::assertThat( $definition, - new \PHPUnit\Framework\Constraint\LogicalNot(new DefinitionHasMethodCallConstraint($method)), + new \PHPUnit\Framework\Constraint\LogicalNot(new DefinitionHasMethodCallConstraint($method)) ); } }