Is there a way for phpDoc to document an array of objects as a parameter?

后端 未结 5 2054
礼貌的吻别
礼貌的吻别 2020-12-17 09:20

In phpDoc-generated documentation I can cause phpDoc to generate a link to a custom type definition for a given param using

@param CustomType $variablename
         


        
5条回答
  •  南方客
    南方客 (楼主)
    2020-12-17 10:14

    New version of PHP doc support /** @var sometype[] */ syntax. Even more complicated: /** @var (sometype|othertype)[] */. http://www.phpdoc.org/docs/latest/guides/types.html#arrays PHPStorm also support this syntax.

提交回复
热议问题