phpstan.dist.neon 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. excludePaths:
  11. - tests/Fixtures
  12. polluteScopeWithLoopInitialAssignments: true # Do not enforce assignments outside of the loops
  13. reportUnmatchedIgnoredErrors: true # Do not allow outdated errors in the baseline
  14. reportPossiblyNonexistentGeneralArrayOffset: true # enabled, but huge exceptions count; example fix: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8089
  15. reportPossiblyNonexistentConstantArrayOffset: true
  16. treatPhpDocTypesAsCertain: false
  17. ignoreErrors:
  18. - '/^Class [a-zA-Z\\]+ extends @final class PhpCsFixer\\(ConfigurationException\\InvalidConfigurationException|ConfigurationException\\InvalidFixerConfigurationException|Tokenizer\\Tokens|Console\\Command\\FixCommand)\.$/'
  19. - '/^\$this\(PhpCsFixer\\Tokenizer\\Tokens\) does not accept PhpCsFixer\\Tokenizer\\Token\|null\.$/'
  20. # We often need to iterate multiple times within single method and we re-use variable name
  21. -
  22. message: '/^For loop initial assignment overwrites variable \$(i|index|endIndex)+\.$/'
  23. paths:
  24. - src/Fixer/Comment/CommentToPhpdocFixer.php
  25. - src/Fixer/ControlStructure/YodaStyleFixer.php
  26. - src/Fixer/Import/GlobalNamespaceImportFixer.php
  27. - src/Fixer/Import/OrderedImportsFixer.php
  28. - src/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixer.php
  29. - src/Fixer/Operator/NoUselessConcatOperatorFixer.php
  30. - src/Fixer/PhpUnit/PhpUnitDedicateAssertInternalTypeFixer.php
  31. - src/Fixer/ReturnNotation/ReturnAssignmentFixer.php
  32. - src/Fixer/Whitespace/StatementIndentationFixer.php
  33. - tests/DocBlock/TypeExpressionTest.php
  34. -
  35. message: '/^Foreach overwrites \$index with its key variable.$/'
  36. paths:
  37. - src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php
  38. - src/Fixer/Import/GlobalNamespaceImportFixer.php
  39. - src/Fixer/LanguageConstruct/GetClassToClassKeywordFixer.php
  40. # Types related to tokens collections are purposefully narrowed, because we expect only tokens there
  41. - '/^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\(\)$/'
  42. - '/^Parameter .* of method PhpCsFixer\\Tokenizer\\Tokens::offsetSet\(\) should be contravariant with parameter .* of method .*::offsetSet\(\)$/'
  43. - '/^Parameter .* of method PhpCsFixer\\Tests\\Test\\TokensWithObservedTransformers::offsetSet\(\) should be contravariant with parameter .* of method .*::offsetSet\(\)$/'
  44. # This one is tricky, because adding @param to PHPDoc causes failures on PHP7.4 with lowest deps (phpdoc_to_param_type), using @phpstan-param causes failures on all PHP versions (phpdoc_add_missing_param_annotation)
  45. - '/^Parameter #1 \$class \(string\) of method PhpCsFixer\\StdinFileInfo::get(File|Path)+Info+\(\) should be contravariant with parameter \$class \(string\|null\) of method SplFileInfo::get(File|Path)+Info\(\)$/'
  46. # PHPUnit data providers return type were not maintained originally, this exception should shrink over time (eg with help of custom, re-usable type)
  47. -
  48. message: '#^Method PhpCsFixer\\Tests\\.+::provide.+Cases\(\) return type has no value type specified in iterable type iterable\.$#'
  49. path: tests
  50. count: 1013
  51. -
  52. identifier: offsetAccess.notFound
  53. path: .
  54. count: 559
  55. tipsOfTheDay: false
  56. tmpDir: dev-tools/phpstan/cache