| 1 | <?php |
||
| 19 | class GitUtils |
||
| 20 | { |
||
| 21 | const PHP_FILES = '/(\.php)$/'; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var array |
||
| 25 | */ |
||
| 26 | private static $files = null; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @return array |
||
| 30 | */ |
||
| 31 | public static function extractCommitedFiles() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param string $pattern |
||
| 49 | * |
||
| 50 | * @return Generator |
||
| 51 | */ |
||
| 52 | public static function commitedFiles($pattern = self::PHP_FILES) |
||
| 60 | } |
||
| 61 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.