Hi,
I have been using PhpEd for quite a while now, and have found it to be overall one of the best solutions out there for PHP development.
Nice one!
However, one of the very few issues I have with the IDE is apparently you have to do a lot of manual typing when it comes to phpDoc comments, when it could just as well be done by the IDE (via PHP5 reflection or something).
I checked out Zend Studio yesterday and was astounded to see the following behaviour:
1. Create your class and functions, eg:
<?php
class MyClass {
function __construct(array $arrIDs, $blnSwitch=false) {
return true;
}
function getStuff(MyClass $objMyClass,$intNumber,$strTitle,array $arrVals,$strOptional=null) {
return 'message';
}
}
?>
?>
|
2. Type the following above your class and function definitions and hit enter: /**
3. You get this:
<?php
/**
* Enter description here...
*
*/
class MyClass {
/**
* Enter description here...
*
* @param array $arrIDs
* @param unknown_type $blnSwitch
* @return unknown
*/
function __construct(array $arrIDs, $blnSwitch=false) {
return true;
}
/**
* Enter description here...
*
* @param MyClass $objMyClass
* @param unknown_type $intNumber
* @param unknown_type $strTitle
* @param array $arrVals
* @param unknown_type $strOptional
* @return unknown
*/
function getStuff(MyClass $objMyClass,$intNumber,$strTitle,array $arrVals,$strOptional=null) {
return 'message';
}
}
?>
|
This is obviously a big time saver! As far as I can tell, PhpEd can not do this (unless I am missing something?).
Would it be possible to implement this?
I would also go one further and suggest that where a type hint is not available for a function parameter, try and see if there is a naming convention going on. For example, you can see that I begin all my string variables $str, integers as $int, and so on. You could then automatically work out the type of the variable and stick that in the phpDoc comments. That would probably have to be to be an option somewhere though.
Thanks for all your hard work!
Matthew