php-code-sniffer

Detect violations of coding standards in PHP, JavaScript and CSS

brewmacoslinux
Try with needOr install directly
Source

About

Check coding standards in PHP, JavaScript and CSS

Commands

phpcsphpcbf

Examples

Check a PHP file for coding standard violations$ phpcs myfile.php
Check all PHP files in a directory with PSR12 standard$ phpcs --standard=PSR12 ./src
Automatically fix violations in a file$ phpcbf myfile.php