So, in PHPDoc one can specify @var above the member variable declaration to hint at its type. Then an IDE, for ex. PHPEd, will know what type of object it's working with and will be able to provide a code insight for that variable. <?php class Test { /** @var SomeObj */ private $someObjInstance; }?> This...
Showing posts with label hint. Show all posts
Showing posts with label hint. Show all posts
21 October, 2020
PHPDoc type hinting for array of objects?
Programing Coderfunda
October 21, 2020
hint, ide, php, phpdoc, var
No comments
So, in PHPDoc one can specify @var above the member
variable declaration to hint at its type. Then an IDE, for ex. PHPEd,
will know what type of object it's working with and will be able to
provide a code insight for that variable.
<?php
class Test
{
/** @var SomeObj */
private $someObjInstance;
}
?>
This...