phpstan.dist.neon 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. # We retrieve these FQNs in various ways, we process them along the way, let's assume it's always class-string
  45. - '/^Parameter #2 \$fullName of class PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\NamespaceUseAnalysis constructor expects class-string, string given\.$/'
  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: 266
  51. tipsOfTheDay: false
  52. tmpDir: dev-tools/phpstan/cache