| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public static function extractCommitedFiles() |
||
| 32 | { |
||
| 33 | if (self::$files === null) { |
||
| 34 | self::$files = array(); |
||
| 35 | $rc = 0; |
||
| 36 | exec('git rev-parse --verify HEAD 2> /dev/null', self::$files, $rc); |
||
| 37 | $against = '4b825dc642cb6eb9a060e54bf8d69288fbee4904'; |
||
| 38 | if ($rc === 0) { |
||
| 39 | $against = 'HEAD'; |
||
| 40 | } |
||
| 41 | exec("git diff-index --cached --name-status $against | egrep '^(A|M)' | awk '{print $2;}'", self::$files); |
||
| 42 | } |
||
| 43 | |||
| 44 | return self::$files; |
||
| 45 | } |
||
| 46 | |||
| 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.