mamuz / PhpDependencyAnalysis

Static code analysis to find violations in a dependency graph
http://mamuz.github.io/PhpDependencyAnalysis/
MIT License
564 stars 45 forks source link

Context of warnings is empty in JSON result #26

Closed cawolf closed 7 years ago

cawolf commented 8 years ago

Hi, first of all, thanks for this great project.

When running the analyzer against our company source code, I noticed that the console logging differs from the JSON result file regarding the contexts of the warnings. While the file paths are being correctly printed in the console, the JSON file contains only empty arrays.

I traced it down to the inability of json_encode to call SplFileInfo::__toString (compare with http://stackoverflow.com/questions/401908/php-tostring-and-json-encode-not-playing-well-together ) and added a little wrapper class to overcome this issue.

I appreciate any feedback and hope you will merge this to your codebase, best regards, Christian A. Wolf

cawolf commented 7 years ago

Hey @mamuz, do you need anything else from me to have a look at this PR? Best regards, Christian

mamuz commented 7 years ago

Hi @cawolf, thanks for the PR and sorry for long waiting. Its merged, next days i will create a new release.