Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<SVN (SubVersion) and PhpEDChinese, Japanese and other "wide" characters>
Last updated: Sat, 13 Jul 2013

TIP: Type hints

PhpED support the following syntax for defining type of variables and properties:

PROPERTIES:
class Y {
   /**
   * @var SomeClassA it is an example1
   */
   public $anX;
   /**
   * @var SomeClassB it is an example2
   */
   public $anY;
}

ARGUMENTS:
/**
* example of basic @param usage
* @param SomeClassC $bax some comments may follow...
* @param SomeClassD $bay some other comments may follow...
*/
function function1($bax, $bay) {
}

// php5 way is supported too:
function function1(SomeClassC $bax, SomeClassD $bay) {
}

RETURNING VALUES:
/**
* example of basic @returns usage
* @returns SomeClassA some comments may follow...
*/
function function1() {
   $v[0] = new SomeClassA();
   return $v[0];
}

note: in case if simple variable was used, type hint would not be required

VARIABLES:
/**
* @var SomeClassE
*/
$a->

// auto-defined:
$d = new SomeClassF();
$d->

If types are properly defined, code insight knows all to show correct code completion


<SVN (SubVersion) and PhpEDChinese, Japanese and other "wide" characters>
Last updated: Sat, 13 Jul 2013