Code Quality

PHP_CodeSniffer Coding Standards Tool

PHP_CodeSniffer detects coding standard violations and can automatically fix many formatting issues.

Overview

PHP_CodeSniffer detects coding standard violations and can automatically fix many formatting issues.

Example

composer require --dev squizlabs/php_codesniffer
vendor/bin/phpcs --standard=PSR12 src
vendor/bin/phpcbf --standard=PSR12 src

Configure a project standard and run checks before merging changes.

Official repository: PHP_CodeSniffer

Evaluation checklist

  • Prefer official documentation and repositories.
  • Check supported PHP versions and release history.
  • Review installation instructions and license terms.
  • Keep dependencies updated and run security checks.