Skip to content

Commit 072042a

Browse files
ivuorinengsherwood
authored andcommitted
Files/FileList::current() - Check files array key
For some unknown reason, doing git precommit hook with husky and PHP 7.4, FileList method `current` tries to access undefined array index and throws RuntimeException. After adding the `isset($this->files[$path]) === false` check, linting works as expected. Remove redundant check
1 parent 4af4d84 commit 072042a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Files/FileList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public function rewind()
184184
public function current()
185185
{
186186
$path = key($this->files);
187-
if ($this->files[$path] === null) {
187+
if (isset($this->files[$path]) === false) {
188188
$this->files[$path] = new LocalFile($path, $this->ruleset, $this->config);
189189
}
190190

0 commit comments

Comments
 (0)