Before this commit, we had two different PHPStan configuration files. One for the lib directory (phpstan.neon) and another one for the tests directory (phpstan-tests.neon). This commit combines both files into one (phpstan.neon) to make it easier to maintain and make changes to PHPStan configurations. As part of this process, it was necessary to change the Robo command `./do qa:phpstan` to call PHPStan only once and to combine php-version-dependent-config-tests.php and php-version-dependent-config-libs.php in a new file called php-version-dependent-config.php. Another benefit of this change is that running PHPStan only once with a single configuration file means that it runs about 20% faster than the previous setup. [MAILPOET-4024]
61 lines
3.0 KiB
Plaintext
61 lines
3.0 KiB
Plaintext
parameters:
|
|
level: 8
|
|
tmpDir: ../../temp/phpstan
|
|
bootstrapFiles:
|
|
- ../../vendor/autoload.php
|
|
- bootstrap.php
|
|
- vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php
|
|
- vendor/php-stubs/woocommerce-stubs/woocommerce-packages-stubs.php
|
|
- ../../vendor/codeception/codeception/autoload.php
|
|
- ../../vendor/codeception/verify/src/Codeception/function.php
|
|
- ../../vendor/codeception/verify/src/Codeception/Verify/Verify.php
|
|
- ../../tests/_support/_generated/AcceptanceTesterActions.php
|
|
- ../../tests/_support/_generated/IntegrationTesterActions.php
|
|
- ../../tests/_support/_generated/UnitTesterActions.php
|
|
scanDirectories:
|
|
- ../../tests/_support
|
|
- ../../tests/acceptance
|
|
- ../../tests/integration
|
|
- ../../tests/unit
|
|
scanFiles:
|
|
- PremiumContainerConfigurator.php
|
|
- ../../vendor-prefixed/twig/twig/src/Extension/CoreExtension.php # phpstan can't find \MailPoetVendor\twig_include function
|
|
- vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php
|
|
- custom-stubs.php
|
|
inferPrivatePropertyTypeFromConstructor: true
|
|
parallel:
|
|
processTimeout: 300.0
|
|
maximumNumberOfProcesses: 4
|
|
ignoreErrors:
|
|
- '#Function members_register_.+ not found#'
|
|
- '#Call to an undefined method MailPoetVendor\\Idiorm\\IdiormResultSet::set\(\)#'
|
|
- '#Argument of an invalid type MailPoetVendor\\pQuery\\IQuery supplied for foreach, only iterables are supported#'
|
|
- '/(with|has) no (return )?typehint specified/' # exclude level 6 errors
|
|
- # Primary keys ScheduledTaskSubscriberEntity of are foreign keys and foreign keys may be null because of missing related record
|
|
message: '#Property MailPoet\\Entities\\[a-zA-Z]+::\$[a-z]+ type mapping mismatch: property can contain MailPoet\\Entities\\[a-zA-Z]+\|null but database expects MailPoet\\Entities\\[a-zA-Z]+.#'
|
|
path: ../../lib/Entities/ScheduledTaskSubscriberEntity.php
|
|
count: 2
|
|
- '/Parameter #1 \$cssOrXPath of method AcceptanceTester::moveMouseOver\(\) expects string\|null, array<string, string> given./'
|
|
- '/Function expect invoked with 1 parameter, 0 required\./'
|
|
- '/Call to method getName\(\) on an unknown class _generated\\([a-zA-Z])*Cookie/' # codeception generate incorrect return type in ../../tests/_support/_generated
|
|
reportUnmatchedIgnoredErrors: true
|
|
dynamicConstantNames:
|
|
- MAILPOET_PREMIUM_INITIALIZED
|
|
doctrine:
|
|
objectManagerLoader: create-entity-manager.php
|
|
|
|
# exclude level 6 errors
|
|
checkMissingIterableValueType: false
|
|
|
|
excludes_analyse:
|
|
- ../../lib/Config/PopulatorData/Templates # analysis of templates is extremely slow, let's skip them for now
|
|
- ../../tests/_support/_generated
|
|
- ../../tests/unit/Entities/SubscriberEntityTest.php
|
|
includes:
|
|
- extensions/CodeceptionExtension/extension.neon
|
|
- vendor/phpstan/phpstan-doctrine/extension.neon
|
|
- vendor/phpstan/phpstan-phpunit/extension.neon
|
|
- vendor/phpstan/phpstan-doctrine/rules.neon
|
|
- vendor/szepeviktor/phpstan-wordpress/extension.neon
|
|
- php-version-dependent-config.php # PHP version detection + configuraton dependent on PHP version
|