Skip to content

Commit 1015bf5

Browse files
Compare file path with same separators
Transform both file paths to have similar path delimiters before comparing them. Proposed solution to issue #54
1 parent 06e4cd5 commit 1015bf5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/FileMatchers/EndsWith.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ protected function fileEndsWith(string $haystack, string $needle): bool
3535
return $this->fileEndsWith($needle, $haystack);
3636
}
3737

38+
$haystack = str_replace('\\', '/', $haystack);
39+
$needle = str_replace('\\', '/', $needle);
40+
3841
return (substr($haystack, -$length) === $needle);
3942
}
4043
}

0 commit comments

Comments
 (0)