forked from shopsys/shopsys
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpstan.neon
83 lines (82 loc) · 5.5 KB
/
phpstan.neon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
parameters:
# limit maximum concurrent job count to prevent server overload
parallel:
maximumNumberOfProcesses: 5
treatPhpDocTypesAsCertain: false
symfony:
container_xml_path: '%currentWorkingDirectory%/project-base/var/cache/dev/srcApp_KernelDevDebugContainer.xml'
constant_hassers: false
ignoreErrors:
# shopsys/framework - don't forget to add these rules to phpstan.neon in framework
-
message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::children\(\)\.$#'
path: %currentWorkingDirectory%/packages/framework/src/Component/Domain/Config/DomainsUrlsConfigDefinition.php
-
message: '#^Method Doctrine\\Persistence\\ObjectManager::flush\(\) invoked with 1 parameter, 0 required\.$#'
path: *
-
message: '#^Property Doctrine\\ORM\\Mapping\\ClassMetadataInfo::\$discriminatorColumn \(array\) does not accept null\.$#'
path: %currentWorkingDirectory%/packages/framework/src/Component/EntityExtension/EntityExtensionParentMetadataCleanerEventSubscriber.php
-
message: '#^Argument of an invalid type Symfony\\Component\\Validator\\Constraint supplied for foreach, only iterables are supported\.$#'
path: %currentWorkingDirectory%/packages/framework/src/Form/JsFormValidatorFactory.php
-
message: '#^Property Shopsys\\FrameworkBundle\\Model\\Order\\Order::\$transport \(Shopsys\\FrameworkBundle\\Model\\Transport\\Transport\) does not accept null\.$#'
path: %currentWorkingDirectory%/packages/framework/src/Model/Order/Order.php
-
message: '#^Property Shopsys\\FrameworkBundle\\Model\\Order\\Order::\$payment \(Shopsys\\FrameworkBundle\\Model\\Payment\\Payment\) does not accept null\.$#'
path: %currentWorkingDirectory%/packages/framework/src/Model/Order/Order.php
-
message: '#^Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) invoked with 2 parameters, 1 required\.$#'
path: %currentWorkingDirectory%/packages/framework/src/*
-
message: '#^Unsafe usage of new static\(\).#'
path: %currentWorkingDirectory%/packages/framework/*
-
# Annotations in Codeception are not well describing
message: '#^Parameter \#(\d+) \$cssOrXPath of method Tests\\(.*)\\Codeception\\(.*) expects (.*)#'
path: %currentWorkingDirectory%/packages/framework/tests/Test/Codeception/*
# shopsys/project-base - don't forget to add these rules to phpstan.neon in project-base
-
# We need to have undefined variable for testing purposes
message: '#^Undefined variable: \$undefined$#'
path: %currentWorkingDirectory%/project-base/src/Controller/Test/ErrorHandlerController.php
-
# We need to have undefined variable for testing purposes
message: '#^Expression "\$undefined\[42\]" on a separate line does not do anything\.$#'
path: %currentWorkingDirectory%/project-base/src/Controller/Test/ErrorHandlerController.php
-
# Ignore annotations in generated code
message: '#^PHPDoc tag @(param|return) has invalid value (.|\n)+ expected type at offset \d+$#'
path: %currentWorkingDirectory%/project-base/tests/App/Test/Codeception/_generated/AcceptanceTesterActions.php
-
# Ignore annotations in generated code
message: '#^PHPDoc tag @throws with type .+ is not subtype of Throwable$#'
path: %currentWorkingDirectory%/project-base/tests/App/Test/Codeception/_generated/AcceptanceTesterActions.php
-
# phpstan-symfony extension cannot work right with symfony test container at the moment https://github.com/phpstan/phpstan-symfony/issues/27
message: '#^Service "[^"]+" is private.$#'
path: %currentWorkingDirectory%/*/tests/*
-
message: '#^Service "test.service_container" is not registered in the container.$#'
path: %currentWorkingDirectory%/*/tests/*
-
message: '#^Service "snc_redis.test" is not registered in the container.$#'
path: %currentWorkingDirectory%/project-base/tests/App/Functional/Component/Redis/Redis*FacadeTest.php
-
message: '#^Service "doctrine.orm.default_metadata_driver" is private.$#'
path: %currentWorkingDirectory%/packages/framework/src/DependencyInjection/Compiler/RegisterExtendedEntitiesCompilerPass.php
-
# Annotations in Codeception are not well describing
message: '#^Parameter \#(\d+) (\$cssOrXPath|\$cssOrXPathOrRegex|\$field|\$selector|\$element) of method (Tests\\(.*)\\Codeception\\(.*)|Codeception\\Module\\WebDriver::moveMouseOver\(\)) expects (.*)#'
path: %currentWorkingDirectory%/project-base/tests/App/*
excludes_analyse:
# Exclude coding standards from packages as it is in incompatible version
- %currentWorkingDirectory%/packages/coding-standards/*
# Exclude "Source" folder dedicated for testing functionality connected to "shopsys:extended-classes:annotations" command
- %currentWorkingDirectory%/packages/framework/tests/Unit/Component/ClassExtension/Source/*
includes:
- vendor/phpstan/phpstan-doctrine/extension.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-symfony/extension.neon
- vendor/phpstan/phpstan-symfony/rules.neon