PHP Syntax checking pre-source control

后端 未结 6 1448
孤城傲影
孤城傲影 2021-02-05 01:30

Referring to Is there a static code analyzer [like Lint] for PHP files? -- I am looking at how to assess the content of PHP files before they are committed by developers.

6条回答
  •  清歌不尽
    2021-02-05 02:19

    while not a command line checker, PHPStorm has to be one of the best IDE's out there.

    It has various inspections which can detect the sort of problems that you've mentioned. Also, it automatically re-runs these inspections on the files you're committing to version control, checking for undefined variables, poor quality code and "todos".

    However the problem with these inspections is that they can't know everything, so they sometimes err on the side of being 'suggestions' or 'warnings' rather than error.

    However, it is quite good at what it does, and it can these sorts of problems while you're editing and, usually it results in fixing the errors well before any commit action anyway.

提交回复
热议问题