phpstan.dist.neon 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. includes:
  2. - dev-tools/vendor/phpstan/phpstan/conf/bleedingEdge.neon
  3. # Baseline, should only shrink! To regenerate it, just execute `composer phpstan:baseline`.
  4. - dev-tools/phpstan/baseline.php
  5. parameters:
  6. level: 7
  7. paths:
  8. - src
  9. - tests
  10. - php-cs-fixer
  11. - dev-tools/phpstan/src
  12. excludePaths:
  13. - tests/Fixtures
  14. polluteScopeWithLoopInitialAssignments: true # Do not enforce assignments outside of the loops
  15. reportUnmatchedIgnoredErrors: true # Do not allow outdated errors in the baseline
  16. reportPossiblyNonexistentGeneralArrayOffset: true # enabled, but huge exceptions count; example fix: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8089
  17. reportPossiblyNonexistentConstantArrayOffset: true
  18. treatPhpDocTypesAsCertain: false
  19. ignoreErrors:
  20. - '/^Class [a-zA-Z\\]+ extends @final class PhpCsFixer\\(ConfigurationException\\InvalidConfigurationException|ConfigurationException\\InvalidFixerConfigurationException|Tokenizer\\Tokens|Console\\Command\\FixCommand)\.$/'
  21. - '/^\$this\(PhpCsFixer\\Tokenizer\\Tokens\) does not accept PhpCsFixer\\Tokenizer\\Token\|null\.$/'
  22. # We often need to iterate multiple times within single method and we re-use variable name
  23. -
  24. message: '/^For loop initial assignment overwrites variable \$(i|index|endIndex)+\.$/'
  25. paths:
  26. - src/Fixer/Comment/CommentToPhpdocFixer.php
  27. - src/Fixer/ControlStructure/YodaStyleFixer.php
  28. - src/Fixer/Import/GlobalNamespaceImportFixer.php
  29. - src/Fixer/Import/OrderedImportsFixer.php
  30. - src/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixer.php
  31. - src/Fixer/Operator/NoUselessConcatOperatorFixer.php
  32. - src/Fixer/PhpUnit/PhpUnitDedicateAssertInternalTypeFixer.php
  33. - src/Fixer/ReturnNotation/ReturnAssignmentFixer.php
  34. - src/Fixer/Whitespace/StatementIndentationFixer.php
  35. - tests/DocBlock/TypeExpressionTest.php
  36. -
  37. message: '/^Foreach overwrites \$index with its key variable.$/'
  38. paths:
  39. - src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php
  40. - src/Fixer/Import/GlobalNamespaceImportFixer.php
  41. - src/Fixer/LanguageConstruct/GetClassToClassKeywordFixer.php
  42. # Types related to tokens collections are purposefully narrowed, because we expect only tokens there
  43. - '/^Parameter #1 \$array \(array<int, PhpCsFixer\\(Tokenizer|Doctrine\\Annotation)+\\Token>\) of method PhpCsFixer\\(Tokenizer|Doctrine\\Annotation)+\\Tokens::fromArray\(\) should be contravariant with parameter \$array \(array<int, mixed>\) of method SplFixedArray<PhpCsFixer\\(Tokenizer|Doctrine\\Annotation)+\\Token>::fromArray\(\)$/'
  44. - '/^Parameter .* of method PhpCsFixer\\Tokenizer\\Tokens::offsetSet\(\) should be contravariant with parameter .* of method .*::offsetSet\(\)$/'
  45. - '/^Parameter .* of method PhpCsFixer\\Tests\\Test\\TokensWithObservedTransformers::offsetSet\(\) should be contravariant with parameter .* of method .*::offsetSet\(\)$/'
  46. # We retrieve these FQNs in various ways, we process them along the way, let's assume it's always class-string
  47. - '/^Parameter #2 \$fullName of class PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\NamespaceUseAnalysis constructor expects class-string, string given\.$/'
  48. # PHPUnit data providers return type were not maintained originally, this exception should shrink over time (eg with help of custom, re-usable type)
  49. -
  50. message: '#^Method PhpCsFixer\\Tests\\.+::provide.+Cases\(\) return type has no value type specified in iterable type iterable\.$#'
  51. path: tests
  52. count: 265
  53. tipsOfTheDay: false
  54. tmpDir: dev-tools/phpstan/cache
  55. services:
  56. -
  57. class: PhpCsFixer\PHPStan\Extension\PregMatchParameterOutExtension
  58. tags:
  59. - phpstan.staticMethodParameterOutTypeExtension
  60. -
  61. class: PhpCsFixer\PHPStan\Extension\PregMatchTypeSpecifyingExtension
  62. tags:
  63. - phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension