This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 146548 - go to declaration on $var = new myClass() must go to __constructor method
Summary: go to declaration on $var = new myClass() must go to __constructor method
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker with 1 vote (vote)
Assignee: rmatous
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-08 17:26 UTC by ndwolf
Modified: 2009-05-14 07:55 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ndwolf 2008-09-08 17:26:44 UTC
when I do a navigation->go to declaration  on a $obj = new myClass("a", "b", "c"); this must go to __construct() method
declaration of the myClass class
not to the class myClass declaration line.
Comment 1 Tomasz Slota 2008-09-18 16:44:33 UTC
I agree, it should behave this way. Radku, do you want to take on this one?
Comment 2 rmatous 2008-09-18 16:59:20 UTC
P4 for me.
Comment 3 rmatous 2008-10-15 14:54:19 UTC

*** This issue has been marked as a duplicate of 143426 ***
Comment 4 tprochazka 2009-01-07 12:43:44 UTC
I think that this feature has one side effect at the moment.
I don't known that I must create new Issue, or I can reopen this.

Problem is, where I have class B that is child of A, and only A has _construct() method.
When i click to class B at this line:
$inst = new B();

Netbeans open class A on the method _construct(), but I need class B. When I clicked to class B, I expected class B, 
not class A.

What do you think?
I think, that Netbeans must open class B and go to _construct() only if exists.
Comment 5 rmatous 2009-01-07 13:03:35 UTC
The current behavior is intentional and right, I think. The same like in this code:
class A {
 function call() {
  echo "call";
 }
}

class B extends A {}
$b = new B();
$b->call();

Jumping into "call" method referenced from $b (last line) will also go into "call" method declaration in "A" class
declaration. 

The behavior in both cases (this one && the one mentioned by you) should be consistent no matter whether its just
constructor or plain method, anyway constructor is method.
Comment 6 tprochazka 2009-01-08 05:56:44 UTC
Yes, when I click to method is logical, that I can this method and I have no interest in which class is. But When I 
click to class name, I can this class.

Netbeans has this behavior in Java code. When you click to class name, go to class constructor or to class definition, 
if class has no constructor. 
Comment 7 tprochazka 2009-05-12 10:21:09 UTC
Please it's possible change actual behavior as I wrote before. The same way as it work in Java. It's very annoying. I 
must daily open many classes which has child of another class a Netbeans always open it's parent :-( 
Comment 8 rmatous 2009-05-13 18:02:00 UTC
Fixed according tprochazka's request:
http://hg.netbeans.org/web-main/rev/cba839250edc
Comment 9 Quality Engineering 2009-05-14 07:55:28 UTC
Integrated into 'main-golden', will be available in build *200905140201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/cba839250edc
User: Radek Matous <rmatous@netbeans.org>
Log: #146548 go to declaration on $var = new myClass() must go to __constructor method