Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ECS TrailingCommaInMultilineFixer config #268

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,4 @@
$config->ruleWithConfiguration(
NativeFunctionInvocationFixer::class,
['include' => ['@all'], 'scope' => 'all', 'strict' => \true]);

$config->ruleWithConfiguration(
TrailingCommaInMultilineFixer::class,
['elements' => ['arrays']]);
};
2 changes: 1 addition & 1 deletion spec/Builder/SitemapBuilderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions spec/Model/SitemapSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions spec/Provider/ProductUrlProviderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down
6 changes: 3 additions & 3 deletions src/Command/GenerateSitemapCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
SitemapIndexBuilderInterface $sitemapIndexBuilder,
Writer $writer,
ChannelRepositoryInterface $channelRepository,
RouterInterface $router
RouterInterface $router,
) {
$this->sitemapRenderer = $sitemapRenderer;
$this->sitemapIndexRenderer = $sitemapIndexRenderer;
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/SitemapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class SitemapController extends AbstractController

public function __construct(
ChannelContextInterface $channelContext,
Reader $reader
Reader $reader,
) {
$this->channelContext = $channelContext;

Expand Down
2 changes: 1 addition & 1 deletion src/Controller/SitemapIndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class SitemapIndexController extends AbstractController

public function __construct(
ChannelContextInterface $channelContext,
Reader $reader
Reader $reader,
) {
$this->channelContext = $channelContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Provider/IndexUrlProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class IndexUrlProvider implements IndexUrlProviderInterface

public function __construct(
RouterInterface $router,
IndexUrlFactoryInterface $sitemapIndexUrlFactory
IndexUrlFactoryInterface $sitemapIndexUrlFactory,
) {
$this->router = $router;
$this->sitemapIndexUrlFactory = $sitemapIndexUrlFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/Provider/ProductUrlProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(
UrlFactoryInterface $urlFactory,
AlternativeUrlFactoryInterface $urlAlternativeFactory,
LocaleContextInterface $localeContext,
ProductImagesToSitemapImagesCollectionGeneratorInterface $productToImageSitemapArrayGenerator
ProductImagesToSitemapImagesCollectionGeneratorInterface $productToImageSitemapArrayGenerator,
) {
$this->productRepository = $productRepository;
$this->router = $router;
Expand Down
2 changes: 1 addition & 1 deletion src/Provider/StaticUrlProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
RouterInterface $router,
UrlFactoryInterface $sitemapUrlFactory,
AlternativeUrlFactoryInterface $urlAlternativeFactory,
array $routes
array $routes,
) {
$this->router = $router;
$this->sitemapUrlFactory = $sitemapUrlFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/Provider/TaxonUrlProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/Routing/SitemapLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class SitemapLoader extends Loader implements RouteLoaderInterface

public function __construct(
SitemapBuilderInterface $sitemapBuilder,
?string $env = null
?string $env = null,
) {
$this->sitemapBuilder = $sitemapBuilder;

Expand Down Expand Up @@ -53,8 +53,8 @@ public function load($resource, $type = null)
[],
'',
[],
['GET']
)
['GET'],
),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
10 changes: 5 additions & 5 deletions tests/DependencyInjection/Compiler/SitemapProviderPassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ public function it_adds_method_call_to_sitemap_builder_if_providers_exist()
'addProvider',
[
new Reference('sylius.sitemap_provider.product'),
]
],
);

$this->assertContainerBuilderHasServiceDefinitionWithMethodCall(
'sylius.sitemap_index_builder',
'addIndexProvider',
[
new Reference('sylius.sitemap_index_provider.index'),
]
],
);
}

Expand All @@ -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',
);
}

Expand All @@ -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)),
);
}
}