Chose type annotation format
Since PhpStorm willingly supports all inline type annotation formats:
/* @var $db PDO */
/* @var PDO $db */
/** @var PDO $db */
/** @var $db PDO */
$db->exec('DELETE FROM pending_jobs');
... do you have any tip on how to pick one? Is there one that's more widespread or has been officially adopted by some major project or standards body?
Please sign in to leave a comment.
https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md#722-var
Thank you. I saw PSR-5 is listed as abandoned so I did some quick research. It seems the text was mostly written by phpDocumentor's author and it'll be the base of phpDocumentor v3. The PSR status is most likely due to not having enough volunteers involved in the draft/review process. There doesn't seem to be any other similar initiative. Other syntaxes are apparently going into oblivion (even Zend Framework seems to be dropping its earlier syntax). And other annotation-aware editors that my coworkers are using don't always understand the first variations but they support the one you've pointed out.