forked from shopsys/shopsys
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpstan.neon
79 lines (78 loc) · 5.07 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
parameters:
# limit maximum concurrent job count to prevent server overload
parallel:
maximumNumberOfProcesses: 5
treatPhpDocTypesAsCertain: false
symfony:
containerXmlPath: '%currentWorkingDirectory%/project-base/app/var/cache/dev/App_KernelDevDebugContainer.xml'
constantHassers: false
ignoreErrors:
# shopsys/framework - don't forget to add these rules to phpstan.neon in framework
-
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: '#^Unsafe usage of new static\(\).#'
path: %currentWorkingDirectory%/packages/framework/*
# 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/app/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/app/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/app/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/app/tests/App/Test/Codeception/_generated/AcceptanceTesterActions.php
-
# Ignore annotations in generated code
message: '#^PHPDoc tag @param for parameter \$function with type callable is not subtype of native type Closure.$#'
path: %currentWorkingDirectory%/project-base/app/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/app/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
-
# in fact, anything can be passed to the load function, it just has a bad annotation
message: '#^Parameter \#1 \$key of method Overblog\\DataLoader\\DataLoaderInterface::load\(\) expects string#'
path: %currentWorkingDirectory%/*
excludePaths:
# 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/*
# Exclude coding standards for generated files
- %currentWorkingDirectory%/project-base/app/tests/App/Test/Codeception/_generated/*
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
- %currentWorkingDirectory%/packages/coding-standards/extension.neon
rules:
- \Shopsys\CodingStandards\Phpstan\EntityShouldHaveFactoryRule
- \Shopsys\CodingStandards\Phpstan\OrmPropertyGetterAndSetterHasNoTypehintRule
- \Shopsys\CodingStandards\Phpstan\OrmPropertyHasNoTypehintRule
- \Shopsys\CodingStandards\Phpstan\EntityDataObjectPropertyHasNoTypehintRule