<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 7: phpcallgraph analyse the wrong file in case of inheritance</title><link>https://sourceforge.net/p/phpcallgraph/bugs/7/</link><description>Recent changes to 7: phpcallgraph analyse the wrong file in case of inheritance</description><atom:link href="https://sourceforge.net/p/phpcallgraph/bugs/7/feed.rss" rel="self"/><language>en</language><lastBuildDate>Sun, 21 Mar 2010 19:35:38 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/phpcallgraph/bugs/7/feed.rss" rel="self" type="application/rss+xml"/><item><title>phpcallgraph analyse the wrong file in case of inheritance</title><link>https://sourceforge.net/p/phpcallgraph/bugs/7/</link><description>&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;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rahal Aboulfeth</dc:creator><pubDate>Sun, 21 Mar 2010 19:35:38 -0000</pubDate><guid>https://sourceforge.net5b03e5f3fda509bf5c4e301655fcecea114de97e</guid></item></channel></rss>