Using Code Insight
From Delphi for PHP Documentation Wiki
Summary: Describes how to use Code Insight.
To invoke Code Completion
- Open your code in the "Code Editor".
- Place your cursor at the desired location.
- Press CTRL+SPACE
A pop-up window displays a list of symbols that are valid at the cursor location.
- Click the desired code symbol to insert it into your source code.
Here is a list of Code Insight operations:
- Items of an object instance: Fields of an object, methods of an object, pay attention to scope (private, protected, public), accesible using ->
- Items of a class (static): Static fields of a class and static methods of a class, accessible using ::
- Items without an object, procedural items: php built-in functions, functions available in the scope, php self-declared variables, global variables, function parameters, accessible using Ctrl+Space
- Parameters for methods, functions and built-in functions: Accesible using (, list of parameters for objectless functions, methods and static members, check phpDoc block parsing, useful to complete types when unknown
- Location for a definition: Accesible using Ctrl+Click, to browse through the source code, must provide line|position|filename of the source containing the declaration for an element (field, property, method, etc)
- phpDoc block parsing: Must be used to complete short description for items parsed and to provide type information for items (field members, parameters, etc)
- Interfaces: Must be also parsed to provide -> for classes that implement interfaces
All Code Insight operations use, if available, the phpDoc block information to complete missing data types and descriptions for classes and methods, here is an example of documenting a method:
/**
* Description
*
* @param type $param1 Description for param1
* @param type $param2 Description for param2
* @return type
*/
function method($param1,$param2)
{
}
This information is shown on the Structure Panel, on Parameter Insight and Code Insight.

