phpstan: issue possibly with phpstan ^0.9, possibly with phpdoc blocks on php-cs-fixer ^2.8
On my php-cs-fixer ruleset I’m getting the following issue:
------ -----------------------------------------------------------------------
Line src\Config.php
------ -----------------------------------------------------------------------
101 Parameter #1 $finder of method PhpCsFixer\Config::setFinder() expects
iterable<string>, PhpCsFixer\Finder given.
I’m not sure if this is an issue relating to the changes between 0.8 & 0.9, or if it’s specifically a phpdoc block issue with php-cs-fixer ?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 24 (19 by maintainers)
@JanTvrdik I’m going to ahead and say the heuristics are currently broken.
iterable|string[]|\Traversableshould be interpreted as accepting eitheriterable<mixed>,array<string>, orTraversable<mixed>Test with the modified heuristics (#650) https://phpstan.org/r/61fcd487e45f1c59c9768149566fb54f
Based on a quick glance I think that the problem is that
setFinder()requiresiterable<string>butSymfony\Component\Finder\Finderreturns in getIterator()iterable<SplFileInfo>.So either
setFinder()method should be updated to acceptiterable<SplFileInfo>orFindermust returniterable<string>.