Son*_*ngo 9 php foreach netbeans autocomplete phpdoc
我有以下代码:
class Orders{
/**
*
* @var Supplier
*/
private $suppliers; //Array of Supplier
function loopAllSuppliers(){
foreach($this->suppliers as $supplier){
$supplier->/*no suggestion*/ //Can't get the method's to show here
$this->suppliers->getSupplierName(); //methods in class Supplier show normally here
}
}
}
Run Code Online (Sandbox Code Playgroud)
问题很简单.我只是想能够为我的变量声明一个类型,$supplier就像我用它做的那样$suppliers.
笔记:
Son*_*ngo 18
class Orders{
/**
*
* @var Supplier
*/
private $suppliers;
function loopAllSuppliers(){
foreach($this->suppliers as $supplier){ /* @var $supplier Supplier */
//Must declare the type again inside the foreach as Netbeans doesn't support
// defining variable as arrays in doc blocks, yet.
}
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7396 次 |
| 最近记录: |