0
在PHP中很常見輸入註釋這樣的變量:關於函數的返回類型PHP類型註釋的功能?
/**
* @var boolean
*/
protected $isLoaded;
可是什麼? PHP Type Annotation是否支持函數的返回類型?
如果是這樣,我怎麼能註釋功能的類圖中的返回類型
-getName():字符串
?
我希望是這樣的:
/**
* @return String
*/
private function getName() {}
但它忽略。
http://php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration – Deadooshka
謝謝,我在找錯地方:http:// php- annotations.readthedocs.io/en/latest/AnnotationLibrary.html?highlight=return 並找不到答案。 – StandardNerd