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 159842 - Enhance code completion for PHP array of objects
Summary: Enhance code completion for PHP array of objects
Status: RESOLVED INVALID
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P1 blocker with 2 votes (vote)
Assignee: issues@php
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-07 00:26 UTC by picov
Modified: 2010-11-15 20:19 UTC (History)
0 users

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 picov 2009-03-07 00:26:44 UTC
Hi,
it could be very useful to add code completion for PHP array of object used as class properties (using the PHPDoc information).

Example:

<?php
class ModuleLoader {

    public
    /**
     * @var Database The database object
     */
    $database,

    /**
     * @var Module[string] Associative array of modules object (or @var array[string]Module ...)
     */
    $modules=array();

    function addDatabase($dbObject) {
		$this->database=$dbObject;
	}

    function addModule($moduleObject) {
		$this->modules[$moduleObject->name]=$moduleObject;
	}

}


Class Database {

    public
    /**
     * @var string The DB server address
     */
    $address;

    function connect() {
        // ....
    }

}

Class Module {
	
    public
    /**
     * @var string Module name
     */
    $name,

    /**
     * @var bool Module autoload option
     */
    $autoload=false;

    function __construct($moduleName) {
            $this->name=$moduleName;
    }

    function loadModuleConfig($fileName) {
            //...
    }
}


$myModuleLoader=new ModuleLoader();


$myDb=new Database();
$myModuleLoader->addDatabase($myDb);

$myModuleLoaden herer->database->connect() <<< code completion is working here

// BUT

$myModule=new Module("moduleA");
$myModule->autoload=true;
$myModuleLoader->addModule($myModule);

$myModuleLoader->modules['moduleA']->? <<< code completion NOT WORKING HERE -> need autocomplete with 'name','autoload','loadModuleConfig'

?>
Comment 1 picov 2009-03-07 00:30:12 UTC
// This also is not working

$modObj=$myModuleLoader->modules['moduleA'];

$modObj->? <<< code completion NOT WORKING here -> need autocomplete with 'name','autoload','loadModuleConfig'
Comment 2 Tomasz Slota 2010-02-10 08:45:59 UTC
reassigning to default owner
Comment 3 Filip Zamboj 2010-09-15 12:28:27 UTC
batch reassigning
Comment 4 Sc0tTyXL 2010-11-15 20:19:13 UTC
This is not a Netbeans issue but a PHPDoc issue.

Once added to the PHPDoc standard, i doubt that the NB devs wouldn't implement it.

http://www.phpdoc.org/