<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 7: phpcallgraph analyse the wrong file in case of inheritance</title><link href="https://sourceforge.net/p/phpcallgraph/bugs/7/" rel="alternate"/><link href="https://sourceforge.net/p/phpcallgraph/bugs/7/feed.atom" rel="self"/><id>https://sourceforge.net/p/phpcallgraph/bugs/7/</id><updated>2010-03-21T19:35:38Z</updated><subtitle>Recent changes to 7: phpcallgraph analyse the wrong file in case of inheritance</subtitle><entry><title>phpcallgraph analyse the wrong file in case of inheritance</title><link href="https://sourceforge.net/p/phpcallgraph/bugs/7/" rel="alternate"/><published>2010-03-21T19:35:38Z</published><updated>2010-03-21T19:35:38Z</updated><author><name>Rahal Aboulfeth</name><uri>https://sourceforge.net/u/aboulfeth/</uri></author><id>https://sourceforge.net5b03e5f3fda509bf5c4e301655fcecea114de97e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br /&gt;
Here is a litte example : &lt;/p&gt;
&lt;p&gt;dad.php&lt;br /&gt;
class Dad { &lt;br /&gt;
function notOverriden() { }&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;child.php&lt;br /&gt;
class Child extends Dad() { &lt;br /&gt;
function childMethod() { }&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;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  )&lt;/p&gt;
&lt;p&gt;Here is my fix : &lt;/p&gt;
&lt;p&gt;In  ( summarizeClassMethods()  )  lib/instantsvc/components/CodeAnalyzer/src/code_analyser.php &lt;/p&gt;
&lt;p&gt;i added  ( before $result[$method-&amp;gt;getName()]['startLine'] = $method-&amp;gt;getStartLine(); ) : &lt;br /&gt;
// because of inheritance , filename may not be the same as the analysed class&lt;br /&gt;
$result[$method-&amp;gt;getName()]['file'] = $method-&amp;gt;getFilename();&lt;/p&gt;
&lt;p&gt;In (   analyseCodeSummary() , src/PHPCallGraph.php ) ,   replaced $class['file']  by  $method['file']&lt;/p&gt;
&lt;p&gt;My graphs seems correct now.&lt;/p&gt;
&lt;p&gt;Thanks again for the great tool.&lt;/p&gt;
&lt;p&gt;Rahal&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>