KDevelop PHP: return type hinting via @retval or other way?
nickygerritsen at me.com
Wed May 28 09:08:30 UTC 2014
Imagine I have the following PHP function in a class called Obfuscated (real name removed for reasons):
* Fetch the ''obfuscated'' associated with a specific (numeric) ID
* @param int $id
* Numeric ID of the ''obfuscated'' to fetch; can be null to let this method return null.
* @retval Obfuscated
* The ''obfuscated'' with the given ID, or null if no such ''obfuscated'' exists
public static function fromId($id)
‘ObfuscatedId' => $id,
fromDatabase does something in the lines of:
protected static function fromDatabase($filter)
$class = get_called_class();
$obj = new $class();
// More code…
In this case KDevelop does not correctly understand the type of the object returned from the fromId() function.
For example PHPStorm can use @return to specify (“force”) the return type of a function. However KDevelop does not seem to support such a feature.
Am I missing something or is this something that could be added?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop