Skip to content

Commit

Permalink
Fix PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
lruozzi9 committed May 13, 2024
1 parent f166037 commit f0380cf
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 2 deletions.
5 changes: 3 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
parameters:
level: max
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
paths:
- src
- tests/Behat

excludes_analyse:
excludePaths:
# Makes PHPStan crash
- 'src/DependencyInjection/Configuration.php'

Expand All @@ -16,3 +15,5 @@ parameters:

ignoreErrors:
- '/Parameter #1 \$configuration of method Symfony\\Component\\DependencyInjection\\Extension\\Extension::processConfiguration\(\) expects Symfony\\Component\\Config\\Definition\\ConfigurationInterface, Symfony\\Component\\Config\\Definition\\ConfigurationInterface\|null given\./'
-
identifier: missingType.iterableValue
3 changes: 3 additions & 0 deletions src/Command/IndexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

final class IndexCommand extends Command
{
/**
* @param ChannelRepositoryInterface<ChannelInterface> $channelRepository
*/
public function __construct(
private readonly ChannelRepositoryInterface $channelRepository,
private readonly MessageBusInterface $messageBus,
Expand Down
3 changes: 3 additions & 0 deletions src/Controller/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
*/
final class ProductController extends AbstractController implements ProductControllerInterface
{
/**
* @param TaxonRepositoryInterface<TaxonInterface> $taxonRepository
*/
public function __construct(
private readonly TaxonRepositoryInterface $taxonRepository,
private readonly LocaleContextInterface $localeContext,
Expand Down
3 changes: 3 additions & 0 deletions src/EventSubscriber/ProductEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

final readonly class ProductEventSubscriber implements EventSubscriberInterface
{
/**
* @param ChannelRepositoryInterface<ChannelInterface> $channelRepository
*/
public function __construct(
private MessageBusInterface $messageBus,
private LoggerInterface $logger,
Expand Down
3 changes: 3 additions & 0 deletions src/EventSubscriber/ProductVariantSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

final readonly class ProductVariantSubscriber implements EventSubscriberInterface
{
/**
* @param ChannelRepositoryInterface<ChannelInterface> $channelRepository
*/
public function __construct(
private MessageBusInterface $messageBus,
private LoggerInterface $logger,
Expand Down
3 changes: 3 additions & 0 deletions src/MessageHandler/CreateIndexHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

final readonly class CreateIndexHandler
{
/**
* @param ChannelRepositoryInterface<ChannelInterface> $channelRepository
*/
public function __construct(
private ChannelRepositoryInterface $channelRepository,
private DocumentTypeProviderInterface $documentTypeProvider,
Expand Down
3 changes: 3 additions & 0 deletions src/MessageHandler/RemoveDocumentIfExistsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

final readonly class RemoveDocumentIfExistsHandler
{
/**
* @param ChannelRepositoryInterface<ChannelInterface> $channelRepository
*/
public function __construct(
private ChannelRepositoryInterface $channelRepository,
private DocumentTypeProviderInterface $documentTypeProvider,
Expand Down
3 changes: 3 additions & 0 deletions src/MessageHandler/UpsertDocumentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

final readonly class UpsertDocumentHandler
{
/**
* @param ChannelRepositoryInterface<ChannelInterface> $channelRepository
*/
public function __construct(
private ChannelRepositoryInterface $channelRepository,
private DocumentTypeProviderInterface $documentTypeProvider,
Expand Down
1 change: 1 addition & 0 deletions src/Parser/ElasticsearchProductDocumentParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ final class ElasticsearchProductDocumentParser implements DocumentParserInterfac

/**
* @param FactoryInterface<ProductImageInterface> $productImageFactory
* @param ProductVariantFactoryInterface<ProductVariantInterface> $productVariantFactory
* @param FactoryInterface<ChannelPricingInterface> $channelPricingFactory
* @param FactoryInterface<CatalogPromotionInterface> $catalogPromotionFactory
* @param FactoryInterface<ProductOptionInterface> $productOptionFactory
Expand Down
3 changes: 3 additions & 0 deletions tests/Behat/Context/Setup/ElasticsearchContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

final readonly class ElasticsearchContext implements Context
{
/**
* @param ChannelRepositoryInterface<ChannelInterface> $channelRepository
*/
public function __construct(
private ChannelRepositoryInterface $channelRepository,
private DocumentTypeProviderInterface $documentTypeProvider,
Expand Down
1 change: 1 addition & 0 deletions tests/Behat/Context/Setup/ProductAttributeContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* @param RepositoryInterface<ProductAttributeInterface> $productAttributeRepository
* @param FactoryInterface<ProductAttributeValueInterface> $productAttributeValueFactory
* @param FactoryInterface<ProductAttributeTranslationInterface> $productAttributeTranslationFactory
* @param AttributeFactoryInterface<ProductAttributeInterface> $productAttributeFactory
*/
public function __construct(
private RepositoryInterface $productAttributeRepository,
Expand Down

0 comments on commit f0380cf

Please sign in to comment.