Good day.
Tell me, is it possible with PhpDoc to comment on methods that return dynamically generated objects. You need this to call for hints in IDE PhpStrom.
The construction of the @return first|second not very convenient, since the number of objects generated is not limited.
Primitive example:
class first { function getMain() { return 'Hello'; } } class second { function getSecond() { return "SeconD"; } } /** * @param $name * */ function getClass( $name ) { return new $name; } $class = getClass( 'first' ); Thanks for the help!