I have a class test and it getData
that returns an object variables that arise in the context of methods magically.
My question is how to properly ohintovat to IDE and phpdoc told was correct. I want to PhpStorm understand what his return as output variables. Does it?
class Test
{
/**
* @param $param
* @return object
*/
function getData($param)
{
// .......
$data = (object)[
'a' => 'aaa',
'b' => 'bbb',
];
return $data;
}
}
$test = new Test();
$data = $test->getData('param');
echo $data->
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.