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 - CC for array is not working as expected
Summary: CC for array is not working as expected
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 2 votes (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on: 150050
Blocks:
  Show dependency tree
 
Reported: 2008-10-09 14:27 UTC by Petr Pisl
Modified: 2012-01-23 10:51 UTC (History)
1 user (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 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.