From 567bc0ce8631865bb1ec86b1037435d10e7dd8d3 Mon Sep 17 00:00:00 2001 From: Mateusz Zalewski Date: Sun, 15 Dec 2024 00:42:50 +0100 Subject: [PATCH] CS fixes --- phpstan.neon | 3 ++- .../SynchronizeProductVariantsCommand.php | 26 +++---------------- src/Command/SynchronizeProductsCommand.php | 26 +++---------------- src/Command/SynchronizeTaxonCommand.php | 26 +++---------------- src/Producer/ProductMessageProducer.php | 2 +- 5 files changed, 15 insertions(+), 68 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 9f95024..e33e675 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,7 +5,6 @@ parameters: parallel: processTimeout: 300.0 reportUnmatchedIgnoredErrors: false - checkMissingIterableValueType: false excludePaths: - %currentWorkingDirectory%/DependencyInjection/Configuration.php @@ -17,3 +16,5 @@ parameters: - '/Call to an undefined method Sylius\\Component\\User\\Model\\UserInterface\:\:isAccountNonExpired\(\)\./' - '/Call to an undefined method Sylius\\Component\\User\\Model\\UserInterface\:\:isAccountNonLocked\(\)\./' - '/Call to an undefined method Sylius\\Component\\User\\Model\\UserInterface\:\:isCredentialsNonExpired\(\)\./' + - + identifier: missingType.iterableValue diff --git a/src/Command/SynchronizeProductVariantsCommand.php b/src/Command/SynchronizeProductVariantsCommand.php index 2cfd214..585621c 100644 --- a/src/Command/SynchronizeProductVariantsCommand.php +++ b/src/Command/SynchronizeProductVariantsCommand.php @@ -23,31 +23,13 @@ class SynchronizeProductVariantsCommand extends BaseSynchronizeCommand { - /** - * @var EntityManagerInterface - */ - private $entityManager; - - /** - * @var ProductVariantMessageProducerInterface - */ - private $productVariantMessageProducer; - - /** - * @var ProductVariantRepositoryInterface - */ - private $productVariantRepository; - + /** @param ProductVariantRepositoryInterface $productVariantRepository */ public function __construct( - EntityManagerInterface $entityManager, - ProductVariantMessageProducerInterface $productVariantMessageProducer, - ProductVariantRepositoryInterface $productVariantRepository + private EntityManagerInterface $entityManager, + private ProductVariantMessageProducerInterface $productVariantMessageProducer, + private ProductVariantRepositoryInterface $productVariantRepository, ) { parent::__construct($entityManager); - - $this->entityManager = $entityManager; - $this->productVariantMessageProducer = $productVariantMessageProducer; - $this->productVariantRepository = $productVariantRepository; } protected function configure(): void diff --git a/src/Command/SynchronizeProductsCommand.php b/src/Command/SynchronizeProductsCommand.php index 6d96c42..8c0b0f3 100644 --- a/src/Command/SynchronizeProductsCommand.php +++ b/src/Command/SynchronizeProductsCommand.php @@ -23,31 +23,13 @@ class SynchronizeProductsCommand extends BaseSynchronizeCommand { - /** - * @var EntityManagerInterface - */ - private $entityManager; - - /** - * @var ProductMessageProducerInterface - */ - private $productMessageProducer; - - /** - * @var ProductRepositoryInterface - */ - private $productRepository; - + /** @param ProductRepositoryInterface $productRepository */ public function __construct( - EntityManagerInterface $entityManager, - ProductMessageProducerInterface $productMessageProducer, - ProductRepositoryInterface $productRepository + private EntityManagerInterface $entityManager, + private ProductMessageProducerInterface $productMessageProducer, + private ProductRepositoryInterface $productRepository, ) { parent::__construct($entityManager); - - $this->entityManager = $entityManager; - $this->productMessageProducer = $productMessageProducer; - $this->productRepository = $productRepository; } protected function configure(): void diff --git a/src/Command/SynchronizeTaxonCommand.php b/src/Command/SynchronizeTaxonCommand.php index 8b396a0..318bf77 100644 --- a/src/Command/SynchronizeTaxonCommand.php +++ b/src/Command/SynchronizeTaxonCommand.php @@ -22,31 +22,13 @@ class SynchronizeTaxonCommand extends BaseSynchronizeCommand { - /** - * @var EntityManagerInterface - */ - private $entityManager; - - /** - * @var TaxonMessageProducerInterface - */ - private $taxonMessageProducer; - - /** - * @var TaxonRepositoryInterface - */ - private $taxonRepository; - + /** @param TaxonRepositoryInterface $taxonRepository */ public function __construct( - EntityManagerInterface $entityManager, - TaxonMessageProducerInterface $taxonMessageProducer, - TaxonRepositoryInterface $taxonRepository + private EntityManagerInterface $entityManager, + private TaxonMessageProducerInterface $taxonMessageProducer, + private TaxonRepositoryInterface $taxonRepository, ) { parent::__construct($entityManager); - - $this->entityManager = $entityManager; - $this->taxonMessageProducer = $taxonMessageProducer; - $this->taxonRepository = $taxonRepository; } protected function configure(): void diff --git a/src/Producer/ProductMessageProducer.php b/src/Producer/ProductMessageProducer.php index dc713f1..df452db 100644 --- a/src/Producer/ProductMessageProducer.php +++ b/src/Producer/ProductMessageProducer.php @@ -33,7 +33,7 @@ class ProductMessageProducer implements ProductMessageProducerInterface public function __construct( ProductSerializerInterface $productSerializer, - MessageBusInterface $messageBus + MessageBusInterface $messageBus, ) { $this->productSerializer = $productSerializer; $this->messageBus = $messageBus;