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 142289 - CC should finish constructor smarter
Summary: CC should finish constructor smarter
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: rmatous
URL:
Keywords:
: 150867 154159 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-30 18:25 UTC by Petr Pisl
Modified: 2009-02-19 22:52 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2008-07-30 18:25:20 UTC
For example in this code:

<?php
class User {
    private $name;
    function __construct($name) {
        $this->name = $name;
    }
    public function getName() {
        return $this->name;
    }
}
$test = new Us|
?>

Invoke cc at possition marked |. The User class is offered. But the cc complete only "User". It should be "User(|)" in
the case that there is defined constructor with parameter/s. If there is not constructor with parameter, then it hould
complete "User()|" or as now "User|".
Comment 1 Tomasz Slota 2008-08-04 10:49:16 UTC
it shouldn't be too difficult to implement
Comment 2 tprochazka 2008-09-12 13:29:18 UTC
In Java code also work ctrl+p shortcut which show all constructor parameters. This would be great for PHP also.
Comment 3 Tomasz Slota 2008-09-18 16:20:09 UTC
tprochazka: see issue 132387
Comment 4 Petr Pisl 2008-09-25 23:43:20 UTC
It should be completed with (|) only if the constructor has a parameter. 
Comment 5 tprochazka 2008-09-26 10:40:07 UTC
I know that PHP allow write $a = new User, but I preffer $a = new User() also when constructor has no parrametr. Maybe 
bacause I'm Java programator also. But this is not only my opinion. For example Zend Studio for Eclipse also add () in 
all case. And this is official IDE from Zend corporation.
Comment 6 Tomasz Slota 2008-10-21 14:31:22 UTC
*** Issue 150867 has been marked as a duplicate of this issue. ***
Comment 7 Tomasz Slota 2008-10-21 14:31:30 UTC
*** Issue 150867 has been marked as a duplicate of this issue. ***
Comment 8 Tomasz Slota 2008-10-21 14:32:25 UTC
multiple duplicates, upgrading to P2
Comment 9 Tomasz Slota 2008-11-30 21:23:52 UTC
*** Issue 154159 has been marked as a duplicate of this issue. ***
Comment 10 rmatous 2008-12-03 11:58:33 UTC
Fixed:
http://hg.netbeans.org/main/rev/cdfd991046cc

index version was increased!
Comment 11 Quality Engineering 2008-12-05 06:18:57 UTC
Integrated into 'main-golden', will be available in build *200812050201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/cdfd991046cc
User: Radek Matous <rmatous@netbeans.org>
Log: #142289 CC should finish constructor smarter
Comment 12 Mikhail Matveev 2009-01-11 13:33:14 UTC
Verified