Skip to content

Commit

Permalink
Revert "Coding standard fixes"
Browse files Browse the repository at this point in the history
This reverts commit af431a0.
  • Loading branch information
stefandoorn committed Mar 23, 2023
1 parent 9919006 commit dc9c5e0
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 30 deletions.
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
3 changes: 1 addition & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->end()
->end()
->end()
->end()
;
->end();

return $treeBuilder;
}
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
5 changes: 2 additions & 3 deletions 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 Expand Up @@ -100,8 +100,7 @@ private function getProducts(): iterable
->setParameter('channel', $this->channel)
->setParameter('enabled', true)
->getQuery()
->getResult()
;
->getResult();
}

private function getLocaleCodes(): array
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
4 changes: 2 additions & 2 deletions src/Routing/SitemapLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public function load($resource, $type = null)
[],
'',
[],
['GET'],
),
['GET']
)
);
}

Expand Down
3 changes: 1 addition & 2 deletions tests/DependencyInjection/Compiler/SitemapParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ final class SitemapParameterTest extends AbstractExtensionTestCase
{
/**
* @test
*
* @dataProvider providers
*/
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))
);
}
}
1 change: 1 addition & 0 deletions tests/Model/ChangeFrequencyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
final class ChangeFrequencyTest extends TestCase
{
/**
* @param $interval
* @dataProvider dataProvider
*/
public function testBasic($interval)
Expand Down

0 comments on commit dc9c5e0

Please sign in to comment.