-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Description
As you know, windows filesystem paths are 'C:\<path\to\project>\<path\in\project>.php'
but AbstractUnitObject::getSourceFile() returns 'C:/<path/to/project>/<path/in/project>.php'
, which means that the indices in CheckStyle.findings[] never match.
I've fixed this temporarily on my machine by adding a str_replace for directory slashes to the enrichUnit() function of src/generator/enricher/checkstyle/CheckStyle.php (and it works!) but since this is a really ugly hack, instead of making a pull request I'm leaving an issue so you can figure out if there's more internals that need to be changed.
Just for reference, my "new" enrichUnit function:
private function enrichUnit(AbstractUnitObject $ctx) {
$file = $ctx->getSourceFile();
$file = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $file);
if (isset($this->findings[$file])) {
$this->processFindings($ctx->asDom(), $this->findings[$file]);
}
}