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 149636

Summary: CC for array is not working as expected
Product: php Reporter: Petr Pisl <ppisl>
Component: EditorAssignee: Ondrej Brejla <obrejla>
Status: RESOLVED FIXED    
Severity: blocker CC: tslota
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 150050    
Bug Blocks:    

Description Petr Pisl 2008-10-09 14:27:17 UTC
Have a source:
<?php
class Address {
    /**
     * Street of residence
     * @var string
     */
    public $street;
    /**
     * City of residence
     * @var string
     */
    public $city;
    
    function __construct($street, $city) {
        $this->street = $street;
        $this->city = $city;
    }
}

$foo[0] = new Address();


CC after $foo[0]-> doesn't work and the cc after $foo-> offers fields from Address object.
Comment 1 Tomasz Slota 2008-10-09 14:34:36 UTC
Confirmed. Do you think we should really offer something after $foo[0]-> though? I don't think this is a real-life use case and it is not trivial to implement.
Comment 2 Petr Pisl 2008-10-09 15:23:04 UTC
Tomasz, the bug is based on a user comment. See
http://blogs.sun.com/netbeansphp/entry/code_completion_for_a_class#comment-1223542124000 , so this is real-life usecase.
The main bug is that we offer after $foo-> the properties of Address.
Comment 3 rmatous 2008-10-15 14:44:24 UTC
Suggested for 7.0 - depends on #150050 
Comment 4 rmatous 2009-09-22 10:26:57 UTC
W can make simple add hoc fix but it makes little sense, I think. We should rather consider better dealing with arrays -
keep information about it in model. P3 -> P2
Comment 5 Filip Zamboj 2010-09-15 12:26:50 UTC
batch reassigning
Comment 6 Ondrej Brejla 2012-01-23 10:51:06 UTC
Implemented in NB 7.2.