Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318629

Summary: Wrong parameters list for constructor is proposed when auto-completing object creation
Product: z_Archived Reporter: Ilya Sedlovsky <purebill>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: gadi, zhaozhongwei
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ilya Sedlovsky CLA 2010-07-01 11:43:04 EDT
Build Identifier: 20100618-0524

If you have class C11 that extends class C1 that extends class C and class C has contructor (__construct method) with mandatory parameter and class C1 has constructor with all parameters are optional and class C11 has no constructor at all then auto-completed class for 'new' construction will produce placeholder for mandatory parameter of the class C.

Reproducible: Always

Steps to Reproduce:
1. Suppose we have PHP code:

class TestBase {
    public function __construct($name, $value = "") {
    }
}

class TestChild extends TestBase {
    public function __construct($name = "") {
    }
}

class TestChild2 extends TestChild {
}

$test = new TestChild2<here one press Ctrl+Space to auto-complete >

2. It will be auto-completed to:

$test = new TestChild2($name)

while it should be:

$test = new TestChild2()
Comment 1 Zhongwei Zhao CLA 2010-07-01 11:56:45 EDT
fixed in both head and branch
Comment 2 Ilya Sedlovsky CLA 2010-07-02 03:48:52 EDT
zhaozhongwei, how can I get the update to my Helios? I've tried to get updates but my version is up to date.
Comment 3 Zhongwei Zhao CLA 2010-07-02 04:55:50 EDT
I think this only works in the nightly build version:(
Comment 4 Gadi Goldbarg CLA 2010-08-25 10:09:19 EDT
Tested on 2.2.1 SR1
Verified - OK