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 147185

Summary: Type resolution of goto declaration is very simple (just new WhateverObject)
Product: php Reporter: Petr Pisl <ppisl>
Component: EditorAssignee: rmatous <rmatous>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Petr Pisl 2008-09-13 21:52:00 UTC
Have a code:

<?php

class Country {
    public $name;
    public $code;
}

class Address {
    public $street;
    public $city;
    /**
     *
     * @var Country
     */
    public $country;
}

class Person {
    /**
     * 
     * @var Address
     */
    private $address;

    function getCity() {
        $this->address->city;
        $this->address->country->name;
    }
}
?>

Try to navigate through hyperlink into declaration of city or name in the getCity method.
Comment 1 rmatous 2008-09-15 07:55:19 UTC
Type resolution of goto declaration is very simple (just new WhateverObject).
Doesn't work:
- phpdoc not taken into account 
- methods chains generally 
- common assignments $a = new WhateverObject; $b = $a; 
- more advanced assignments like: $a = $b = $c = new new WhateverObject;
- in catch block is known type catch (MyException exc)
- instanceof block if ($v instanceof MyObject)

As a result goto declaration doesn't work properly.

Deserves a couple of days of coding, almost all this behavior was added already into CC (approximately during last 3 weeks)
Comment 2 rmatous 2008-09-23 14:55:49 UTC
Marking as duplicate of #143426

*** This issue has been marked as a duplicate of 143426 ***