Skip to content

Commit 21d960e

Browse files
committed
Handle slashes on windows
Handle slashes on windows, otherwise one may receive duplicated entries in result page: `D:\app/controllers/BaseController.php`, `D:\app\controllers\BaseController.php` and so on, particularly with PHPUnit coverage report.
1 parent d8373ab commit 21d960e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/PHPCodeBrowser/File.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ class File
8989
*/
9090
public function __construct($name, array $issues = array())
9191
{
92+
if (DIRECTORY_SEPARATOR !== '/')
93+
{
94+
$name = str_replace('/', DIRECTORY_SEPARATOR, $name);
95+
}
96+
9297
$this->name = $name;
9398
$this->issues = $issues;
9499
}

0 commit comments

Comments
 (0)