-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathphpstan.neon.dist
74 lines (71 loc) · 4.73 KB
/
phpstan.neon.dist
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
# https://phpstan.org/config-reference
parametersSchema:
gitattributesExportInclude: listOf(string())
parameters:
exceptions:
check:
missingCheckedExceptionInThrows: true
tooWideThrowType: true
level: max
tmpDir: var/phpstan
paths:
- .gitattributes
- config/services.yml
- docs/services.yml
- src
treatPhpDocTypesAsCertain: false
gitattributesExportInclude:
- composer.json
- docs
- LICENSE
- src
ignoreErrors:
# Production code.
-
message: '#Built-in or third party exception "\\InvalidArgumentException" cannot be thrown from public methods.*#'
path: src/Internal/Translation/Service/SymfonyTranslatorProxy.php
-
message: '#Call to function assert\(\) with false and string will always evaluate to false.#'
paths:
- src/Internal/Translation/Service/Translator.php
- src/Internal/Translation/Value/TranslationParameters.php
-
message: '#Cannot access offset .(application|name). on mixed.#'
path: src/Internal/Precondition/Service/ComposerIsAvailable.php
-
message: '#Method .*SymfonyTranslatorProxy::trans\(\) has parameter \$parameters with no value type specified in iterable type array.*#'
path: src/Internal/Translation/Service/SymfonyTranslatorProxy.php
-
message: '#Method run\(\) should not be public because it doesn''t implement a method on an interface.#'
path: src/Internal/Process/Service/AbstractProcessRunner.php
-
message: '#Method create\(\) should not be public because it doesn''t implement a method on an interface.#'
path: src/Internal/Translation/Service/Translator.php
# https://phpstan.org/developing-extensions/extension-types
rules:
- PhpTuf\ComposerStager\PHPStan\Rules\Calls\NoCallingTranslatableFactoryDirectlyRule # Forbids calling TranslatableFactory::create() directly.
- PhpTuf\ComposerStager\PHPStan\Rules\Calls\NoInstantiatingTranslatableDirectlyRule # Forbids instantiating translatables directly.
- PhpTuf\ComposerStager\PHPStan\Rules\Calls\ValidTranslatableStringsRule # Ensures that TranslatableAwareTrait::t() is only called with literal string messages.
- PhpTuf\ComposerStager\PHPStan\Rules\Classes\FinalExceptionRule # Forbids exceptions from being final.
- PhpTuf\ComposerStager\PHPStan\Rules\Classes\MissingExceptionInterfaceRule # Requires exceptions to implement ExceptionInterface.
- PhpTuf\ComposerStager\PHPStan\Rules\Classes\MissingInterfaceRule # Requires concrete classes to implement an interface.
- PhpTuf\ComposerStager\PHPStan\Rules\Classes\WrongExceptionNamespaceRule # Requires exceptions to be in the correct namespace.
- PhpTuf\ComposerStager\PHPStan\Rules\Files\ExampleServicesConfigIsCurrentRule # Ensures that the example docs/services.yml is current.
- PhpTuf\ComposerStager\PHPStan\Rules\Files\InternalLayerExposureRule # Ensures that a client autoloaders don't depend on the Internal layer.
- PhpTuf\ComposerStager\PHPStan\Rules\Interfaces\UselessInterfaceRule # Forbids empty interfaces, i.e., without methods or constants.
- PhpTuf\ComposerStager\PHPStan\Rules\Methods\ForbiddenConcreteTypeHintRule # Forbids using concrete classes in type hints when an interface is available.
- PhpTuf\ComposerStager\PHPStan\Rules\Methods\ForbiddenThrowsRule # Forbids throwing third party exceptions from public methods.
- PhpTuf\ComposerStager\PHPStan\Rules\Methods\NoNonInterfacePublicMethodsRule # Forbids public methods that are not on an interface.
- PhpTuf\ComposerStager\PHPStan\Rules\PhpDoc\CoverageAnnotationHasNoParenthesesRule # Ensures that coverage annotations have no trailing parentheses.
- PhpTuf\ComposerStager\PHPStan\Rules\PhpDoc\PackageAnnotationRule # Enforces "@package" class annotation rules.
- PhpTuf\ComposerStager\PHPStan\Rules\PhpDoc\PropertyDataTypePutsObjectProphecyLastRule # Requires "@property" data types to put ObjectProphecy last.
- PhpTuf\ComposerStager\PHPStan\Rules\PhpDoc\TranslatablePhpDocRule # Ensures that the docblockss for TranslatableMessage creation methods stay in sync.
- PhpTuf\ComposerStager\PHPStan\Rules\PhpDoc\TranslationParametersPhpDocRule # Ensures that the docblockss for TranslationParameters creation methods stay in sync.
services:
-
# Ensures that a conscious decision is made about whether to include new repository root paths in Git archive files.
class: PhpTuf\ComposerStager\PHPStan\Rules\Files\GitattributesMissingExportIgnoreRule
arguments:
gitattributesExportInclude: %gitattributesExportInclude%
tags:
- phpstan.rules.rule