Hi,
Here is a litte example :
dad.php
class Dad {
function notOverriden() { }
}
child.php
class Child extends Dad() {
function childMethod() { }
}
Well, in phpcallgraph 0.8 , the notOverriden method is analysed in child.php ( using lineStart and lineEnd form dad.php ) ( which leads to incorrect graphs )
Here is my fix :
In ( summarizeClassMethods() ) lib/instantsvc/components/CodeAnalyzer/src/code_analyser.php
i added ( before $result[$method->getName()]['startLine'] = $method->getStartLine(); ) :
// because of inheritance , filename may not be the same as the analysed class
$result[$method->getName()]['file'] = $method->getFilename();
In ( analyseCodeSummary() , src/PHPCallGraph.php ) , replaced $class['file'] by $method['file']
My graphs seems correct now.
Thanks again for the great tool.
Rahal