Skip to content

Commit

Permalink
OP-278 - Apply ECS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SzymonKostrubiec committed Jun 3, 2024
1 parent 95e8a44 commit 79c08b2
Show file tree
Hide file tree
Showing 48 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion src/Controller/Action/Admin/ImportDataAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(
FormErrorsFlashHelperInterface $formErrorsFlashHelper,
TranslatorInterface $translator,
Environment $twig,
) {
) {
$this->importProcessor = $importProcessor;
$this->formFactory = $formFactory;
$this->requestStack = $requestStack;
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Action/Admin/ProductSearchAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(
ProductRepositoryInterface $productRepository,
LocaleContextInterface $localeContext,
ViewHandler $viewHandler,
) {
) {
$this->productRepository = $productRepository;
$this->localeContext = $localeContext;
$this->viewHandler = $viewHandler;
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Action/Admin/TaxonSearchAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(
TaxonRepositoryInterface $taxonRepository,
LocaleContextInterface $localeContext,
ViewHandler $viewHandler,
) {
) {
$this->taxonRepository = $taxonRepository;
$this->localeContext = $localeContext;
$this->viewHandler = $viewHandler;
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Action/Admin/UploadEditorImageAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(
MediaProviderResolverInterface $mediaProviderResolver,
MediaRepositoryInterface $mediaRepository,
FactoryInterface $mediaFactory,
) {
) {
$this->mediaProviderResolver = $mediaProviderResolver;
$this->mediaRepository = $mediaRepository;
$this->mediaFactory = $mediaFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/Fixture/Factory/BlockFixtureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(
private TaxonsAssignerInterface $taxonsAssigner,
private SectionsAssignerInterface $sectionsAssigner,
private ChannelsAssignerInterface $channelAssigner,
) {
) {
}

public function load(array $data): void
Expand Down
4 changes: 2 additions & 2 deletions src/Fixture/Factory/FrequentlyAskedQuestionFixtureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(
private FactoryInterface $frequentlyAskedQuestionTranslationFactory,
private FrequentlyAskedQuestionRepositoryInterface $frequentlyAskedQuestionRepository,
private ChannelsAssignerInterface $channelAssigner,
) {
) {
}

public function load(array $data): void
Expand Down Expand Up @@ -52,7 +52,7 @@ private function createFrequentlyAskedQuestion(
string $code,
array $frequentlyAskedQuestionData,
int $position,
): void {
): void {
/** @var FrequentlyAskedQuestionInterface $frequentlyAskedQuestion */
$frequentlyAskedQuestion = $this->frequentlyAskedQuestionFactory->createNew();

Expand Down
2 changes: 1 addition & 1 deletion src/Fixture/Factory/MediaFixtureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(
private ProductsAssignerInterface $productsAssigner,
private SectionsAssignerInterface $sectionsAssigner,
private ChannelsAssignerInterface $channelAssigner,
) {
) {
}

public function load(array $data): void
Expand Down
8 changes: 4 additions & 4 deletions src/Fixture/Factory/PageFixtureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(
private ProductRepositoryInterface $productRepository,
private LocaleContextInterface $localeContext,
private ChannelRepositoryInterface $channelRepository,
) {
) {
}

public function load(array $data): void
Expand Down Expand Up @@ -71,7 +71,7 @@ private function createPage(
string $code,
array $pageData,
bool $generateSlug = false,
): void {
): void {
/** @var PageInterface $page */
$page = $this->pageFactory->createNew();
$products = $pageData['products'];
Expand Down Expand Up @@ -124,7 +124,7 @@ private function resolveProductsForChannels(
PageInterface $page,
int $limit,
array $channelCodes,
): void {
): void {
foreach ($channelCodes as $channelCode) {
/** @var ChannelInterface|null $channel */
$channel = $this->channelRepository->findOneByCode($channelCode);
Expand All @@ -138,7 +138,7 @@ private function resolveProductsForChannel(
PageInterface $page,
int $limit,
ChannelInterface $channel,
): void {
): void {
$products = $this->productRepository->findLatestByChannel(
$channel,
$this->localeContext->getLocaleCode(),
Expand Down
2 changes: 1 addition & 1 deletion src/Fixture/Factory/SectionFixtureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(
private FactoryInterface $sectionFactory,
private FactoryInterface $sectionTranslationFactory,
private SectionRepositoryInterface $sectionRepository,
) {
) {
}

public function load(array $data): void
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/MediaAutocompleteChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function buildView(
FormView $view,
FormInterface $form,
array $options,
): void {
): void {
$view->vars['remote_criteria_type'] = 'contains';
$view->vars['remote_criteria_name'] = 'phrase';
$view->vars['media_type'] = $options['media_type'];
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/MediaType.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(
string $dataClass,
array $validationGroups = [],
array $providers = [],
) {
) {
parent::__construct($dataClass, $validationGroups);

$this->providers = $providers;
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/SectionAutocompleteChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function buildView(
FormView $view,
FormInterface $form,
array $options,
): void {
): void {
$view->vars['remote_criteria_type'] = 'contains';
$view->vars['remote_criteria_name'] = 'phrase';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Importer/AbstractImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function getTranslatableColumnValue(
string $column,
$locale,
array $row,
) {
) {
$column = str_replace('__locale__', '_' . $locale, $column);

if (array_key_exists($column, $row)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Importer/BlockImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(
private ImporterProductsResolverInterface $importerProductsResolver,
ValidatorInterface $validator,
private BlockRepositoryInterface $blockRepository,
) {
) {
parent::__construct($validator);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Importer/MediaImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(
private ImporterProductsResolverInterface $importerProductsResolver,
ValidatorInterface $validator,
private MediaRepositoryInterface $mediaRepository,
) {
) {
parent::__construct($validator);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Importer/PageImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
private ImporterProductsResolverInterface $importerProductsResolver,
ValidatorInterface $validator,
private EntityManagerInterface $entityManager,
) {
) {
parent::__construct($validator);
}

Expand Down Expand Up @@ -94,7 +94,7 @@ private function resolveImage(
string $url,
string $locale,
string $imageCode,
): void {
): void {
$downloadedImage = $this->imageDownloader->download($url);

/** @var MediaInterface $image */
Expand Down
4 changes: 2 additions & 2 deletions src/MediaProvider/GenericProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(
private Environment $twigEngine,
private string $template,
private string $pathPrefix,
) {
) {
}

public function getTemplate(): string
Expand All @@ -33,7 +33,7 @@ public function render(
MediaInterface $media,
?string $template = null,
array $options = [],
): string {
): string {
return $this->twigEngine->render($template ?? $this->template, array_merge(['media' => $media], $options));
}

Expand Down
2 changes: 1 addition & 1 deletion src/MediaProvider/ProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function render(
MediaInterface $media,
?string $template = null,
array $options = [],
): string;
): string;

public function upload(MediaInterface $media): void;
}
2 changes: 1 addition & 1 deletion src/Processor/ImportProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(
private ImporterChainInterface $importerChain,
private ReaderInterface $reader,
private EntityManagerInterface $entityManager,
) {
) {
}

public function process(string $resourceCode, string $filePath): void
Expand Down
4 changes: 2 additions & 2 deletions src/Repository/BlockRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function findBySectionCode(
string $sectionCode,
string $localeCode,
string $channelCode,
): array {
): array {
return $this->createQueryBuilder('o')
->leftJoin('o.translations', 'translation')
->innerJoin('o.sections', 'section')
Expand All @@ -64,7 +64,7 @@ public function findByProductCode(
string $productCode,
string $localeCode,
string $channelCode,
): array {
): array {
return $this->createQueryBuilder('o')
->leftJoin('o.translations', 'translation')
->innerJoin('o.products', 'product')
Expand Down
4 changes: 2 additions & 2 deletions src/Repository/BlockRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ public function findBySectionCode(
string $sectionCode,
string $localeCode,
string $channelCode,
): array;
): array;

public function findByProductCode(
string $productCode,
string $localeCode,
string $channelCode,
): array;
): array;
}
6 changes: 3 additions & 3 deletions src/Repository/MediaRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function findOneEnabledByCode(
string $code,
string $localeCode,
string $channelCode,
): ?MediaInterface {
): ?MediaInterface {
return $this->createQueryBuilder('o')
->leftJoin('o.translations', 'translation')
->innerJoin('o.channels', 'channels')
Expand All @@ -48,7 +48,7 @@ public function findBySectionCode(
string $sectionCode,
string $localeCode,
string $channelCode,
): array {
): array {
return $this->createQueryBuilder('o')
->leftJoin('o.translations', 'translation')
->innerJoin('o.sections', 'section')
Expand All @@ -69,7 +69,7 @@ public function findByProductCode(
string $productCode,
string $localeCode,
string $channelCode,
): array {
): array {
return $this->createQueryBuilder('o')
->leftJoin('o.translations', 'translation')
->innerJoin('o.products', 'product')
Expand Down
6 changes: 3 additions & 3 deletions src/Repository/MediaRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ public function findOneEnabledByCode(
string $code,
string $localeCode,
string $channelCode,
): ?MediaInterface;
): ?MediaInterface;

public function findBySectionCode(
string $sectionCode,
string $localeCode,
string $channelCode,
): array;
): array;

public function findByProductCode(
string $productCode,
string $localeCode,
string $channelCode,
): array;
): array;
}
6 changes: 3 additions & 3 deletions src/Repository/PageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function findOneEnabledBySlugAndChannelCode(
string $slug,
?string $localeCode,
string $channelCode,
): ?PageInterface {
): ?PageInterface {
return $this->createQueryBuilder('o')
->leftJoin('o.translations', 'translation')
->innerJoin('o.channels', 'channels')
Expand Down Expand Up @@ -105,7 +105,7 @@ public function findByProduct(
ProductInterface $product,
string $channelCode,
?\DateTimeInterface $date = null,
): array {
): array {
$qb = $this->createQueryBuilder('o')
->innerJoin('o.products', 'product')
->innerJoin('o.channels', 'channel')
Expand All @@ -131,7 +131,7 @@ public function findByProductAndSectionCode(
string $sectionCode,
string $channelCode,
?\DateTimeInterface $date = null,
): array {
): array {
$qb = $this->createQueryBuilder('o')
->innerJoin('o.products', 'product')
->innerJoin('o.sections', 'section')
Expand Down
6 changes: 3 additions & 3 deletions src/Repository/PageRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function findOneEnabledBySlugAndChannelCode(
string $slug,
?string $localeCode,
string $channelCode,
): ?PageInterface;
): ?PageInterface;

public function createShopListQueryBuilder(string $sectionCode, string $channelCode): QueryBuilder;

Expand All @@ -37,12 +37,12 @@ public function findByProduct(
ProductInterface $product,
string $channelCode,
?\DateTimeInterface $date,
): array;
): array;

public function findByProductAndSectionCode(
ProductInterface $product,
string $sectionCode,
string $channelCode,
?\DateTimeInterface $date,
): array;
): array;
}
2 changes: 1 addition & 1 deletion src/Resolver/BlockResourceResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(
private BlockRepositoryInterface $blockRepository,
private LoggerInterface $logger,
private ChannelContextInterface $channelContext,
) {
) {
}

public function findOrLog(string $code): ?BlockInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Resolver/MediaResourceResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
private LocaleContextInterface $localeContext,
private ChannelContextInterface $channelContext,
private LoggerInterface $logger,
) {
) {
}

public function findOrLog(string $code): ?MediaInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Resolver/PageResourceResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(
private PageRepositoryInterface $pageRepository,
private LocaleContextInterface $localeContext,
private LoggerInterface $logger,
) {
) {
}

public function findOrLog(string $code): ?PageInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Resolver/ResourceResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(
private RepositoryInterface $repository,
private FactoryInterface $factory,
private string $uniqueColumn,
) {
) {
}

/**
Expand Down
Loading

0 comments on commit 79c08b2

Please sign in to comment.