Difference between revisions of "PHPStan/configuration"
< PHPStan
Jump to navigation
Jump to search
(Created page with "Here is a configuration I used during a quality audit for the Meza project {{Collapsible | visible_text= sample configuration for testing many extensions | collapsed_content=...") |
(look at one extension at a time) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | Here is a configuration I used during a quality audit for | + | Here is a configuration I used during a quality audit for a large installed base of extensions |
{{Collapsible | {{Collapsible | ||
| visible_text= sample configuration for testing many extensions | | visible_text= sample configuration for testing many extensions | ||
Line 11: | Line 11: | ||
editorUrlTitle: '%%relFile%%:%%line%%' | editorUrlTitle: '%%relFile%%:%%line%%' | ||
# phpVersion: 70400 # PHP 7.4 | # phpVersion: 70400 # PHP 7.4 | ||
+ | ## Target a particular PHP version for compliance (really only works if your analysis is running that version) | ||
phpVersion: 80100 # PHP 8.1 | phpVersion: 80100 # PHP 8.1 | ||
− | level: | + | level: 5 |
paths: | paths: | ||
− | |||
- extensions/Arrays #4 (unknown class ExtRegexFun) | - extensions/Arrays #4 (unknown class ExtRegexFun) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
scanDirectories: | scanDirectories: | ||
Line 132: | Line 35: | ||
# - '#.+ no value type specified in iterable type .+#' | # - '#.+ no value type specified in iterable type .+#' | ||
- '#ExtRegexFun#' | - '#ExtRegexFun#' | ||
− | # | + | # - '#Constant [a-zA-Z0-9\\_]+ not found#' |
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
+ | |||
+ | PHPStan offers many '[https://phpstan.org/user-guide/output-format output formats]' (and you can write your own too). The 'raw' format is probably most like what you get from [[Phan]] |
Latest revision as of 17:25, 23 February 2024
Here is a configuration I used during a quality audit for a large installed base of extensions
sample configuration for testing many extensions
parameters:
# should make regular 'table' output also include clickable links for VSCode
editorUrl: 'vscode://file/%%file%%:%%line%%'
# should output a title to the link that you can copy/paste to your editor
editorUrlTitle: '%%relFile%%:%%line%%'
# phpVersion: 70400 # PHP 7.4
## Target a particular PHP version for compliance (really only works if your analysis is running that version)
phpVersion: 80100 # PHP 8.1
level: 5
paths:
- extensions/Arrays #4 (unknown class ExtRegexFun)
scanDirectories:
- includes
- languages
- maintenance
- mw-config
- resources
- vendor
- tests/common
- tests/parser
- tests/phpunit/mocks
excludePaths:
analyse:
- vendor
- *Factory*
- */lib/*
ignoreErrors:
# - '#.+ no value type specified in iterable type .+#'
- '#ExtRegexFun#'
# - '#Constant [a-zA-Z0-9\\_]+ not found#'
PHPStan offers many 'output formats' (and you can write your own too). The 'raw' format is probably most like what you get from Phan