Sylius/phpstan.neon.dist
2026-06-17 14:33:43 +02:00

68 lines
3.5 KiB
Text

includes:
- phpstan-baseline.neon
parameters:
level: 6
reportUnmatchedIgnoredErrors: false
treatPhpDocTypesAsCertain: false
paths:
- 'src/'
excludePaths:
# Test dependencies
- '**/Abstraction/*/tests/**.php'
- '**/Bundle/*/test/**.php'
- '**/Bundle/*/test/app/**.php'
- '**/Bundle/*/test/src/**.php'
- '**/Bundle/*/tests/**.php'
- '**/Bundle/*/Tests/**.php'
- '**/Component/*/tests/**.php'
- 'src/Sylius/Behat/**.php'
# Vendor files in subpackages
- '**/Bundle/*/vendor/**.php'
- '**/Component/*/vendor/**.php'
# Temporary exclusion during upgrade to API Platform 3
- 'src/Sylius/Bundle/ApiBundle/**.php'
# Optional Winzou State Machine
- 'src/Sylius/Abstraction/StateMachine/src/WinzouStateMachineAdapter.php'
ignoreErrors:
# Deprecated property, will be removed in Sylius 3.0
-
message: '/Property Sylius\\Bundle\\AdminBundle\\Notification\\HubNotificationProvider::\$clock is never read, only written\./'
identifier: property.onlyWritten
count: 1
path: src/Sylius/Bundle/AdminBundle/Notification/HubNotificationProvider.php
- identifier: missingType.generics # This need to be fixed, too many classes are using generics without PHPDoc type
# Symfony 7.4 introduced generics on NodeBuilder which phpstan-symfony does not handle correctly yet
# See: https://github.com/phpstan/phpstan-symfony/issues/431
-
message: '#Call to method \w+Node\(\) on an unknown class Symfony\\Component\\Config\\Definition\\Builder\\NodeBuilder<.*>#'
identifier: class.notFound
- '/(Interface|Class) [a-zA-Z\\]+Repository[a-zA-Z\\]* specifies template type (\w+) of interface [a-zA-Z\\]+ as [a-zA-Z\\]+ (of [a-zA-Z\\]+ )?but it''s already specified as/' # turns off a weird generics check behavior for repositories
- '/Method Sylius\\Bundle\\(Admin|Shop)Bundle\\Twig\\Component\\[a-zA-Z\\]+\:\:getDataModelValue\(\) is unused./'
- '/Method Sylius\\Component\\(\w+)\\Model\\(\w+)\:\:getId\(\) has no return type specified./'
- '/Unable to resolve the template type T in call to method Doctrine\\Persistence\\ObjectManager\:\:getRepository\(\)/' # Doctrine's ObjectManager is not generic-aware
- '/Trait Sylius\\Bundle\\CoreBundle\\Application\\SyliusPluginTrait is used zero times and is not analysed\./' # Exposed for plugins' usage
# Intentional overrides
- '/PHPDoc type string of property Sylius\\Bundle\\PayumBundle\\Request\\GetStatus\:\:\$status is not covariant with PHPDoc type int of overridden property Payum\\Core\\Request\\BaseGetStatus\:\:\$status\./'
- '/Method Sylius\\Bundle\\UserBundle\\Controller\\UserController\:\:getUser\(\) overrides @final method Sylius\\Bundle\\ResourceBundle\\Controller\\ResourceController\:\:getUser\(\)\./'
# Symfony 6.4
- message: '/Method Symfony\\Component\\HttpKernel\\CacheWarmer\\WarmableInterface::warmUp\(\) invoked with 2 parameters, 1 required\./'
identifier: arguments.count
count: 1
path: src/Sylius/Bundle/ShopBundle/Router/LocaleStrippingRouter.php
# DBAL 3.x/4.x compatibility - getSchemaManager() removed in DBAL 4.x
-
message: '/Call to an undefined method Doctrine\\DBAL\\Connection::getSchemaManager\(\)\./'
identifier: method.notFound
paths:
- src/Sylius/Bundle/CoreBundle/Migrations/