You can use PHPCS
You will need to add your own rules for PHPDOC, here Sniff
I think you add it to your rules with:
<?xml version="1.0"?> <ruleset name="My rules"> <rule ref="Squiz.Commenting.FunctionCommentThrowTag" /> </ruleset>
But I have not tested this. Confirmed work ... now I have phpdoc to add.: /
My phpcs.xml:
<?xml version="1.0"?> <ruleset name="PSR1/2"> <description>Example</description> <file>./api</file> <exclude-pattern>*/Database/Proxies/*</exclude-pattern> <rule ref="PSR1" /> <rule ref="PSR2" /> <rule ref="Squiz.Commenting.FunctionCommentThrowTag" /> </ruleset>
$ bin / phpcs
FILE: ... ttpdocs / api / Api / Version1 / Software / AbstractSoftwareController.php
-------------------------------------------------- --------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------- --------------------
60 | ERROR | Missing @throws tag for "\ DomainException" exception
-------------------------------------------------- --------------------
Time: 5.55 secs; Memory: 19.5Mb
source share