Lintint multiple files with the PHP CLI

Published on 2024-09-29 • Modified on 2024-09-29

This snippet shows how to lint multiple files with the PHP CLI. Passing multiple files to the PHP executable is only possible as of PHP 8.3. Adding a CI job for this may not be needed as other static analysis tools like PHPStan also report invalid PHP files.


php -l src/**/*.php public/*.php

 More on Stackoverflow   Read the doc  More on the web  Random snippet

  Work with me!


Call to action

Did you like this post? You can help me back in several ways: (use the "reply" link on the right to comment or to contact me )

Thank you for reading! And see you soon on Strangebuzz! 😉

COil