slevomat/coding-standard ↗
Created Dec 13, 2020 · View the slevomat/coding-standard repository page
Slevomat Coding Standard for PHP_CodeSniffer provides many useful sniffs
Want this for your repo?
Render a free sample of any GitHub repo in seconds.
About slevomat/coding-standard
Slevomat Coding Standard is a comprehensive set of sniffs for PHP_CodeSniffer that helps enforce consistent code style and quality in PHP projects. The package provides over 150 individual sniffs organized into three main categories: functional sniffs that improve code safety and behavior, cleaning sniffs that detect dead code, and formatting sniffs that enforce consistent visual style. It supports modern PHP versions including PHP 7 and PHP 8, with particular attention to newer language features like attributes, enums, constructor property promotion, and union types.
The sniffs cover a wide range of concerns including array handling, class structure and naming, comments and documentation, control flow structures, exception handling, function declarations, namespace organization, operators, and type hints. Many of the sniffs support automatic fixing of violations, making it easy to apply coding standards across entire codebases. Others can be suppressed at the file or line level when necessary. The standard is highly configurable, allowing teams to choose which sniffs to enable or disable based on their specific coding preferences and project requirements.
This tool is intended for PHP development teams of all sizes who want to maintain consistent, safe, and well-documented code. It integrates into standard development workflows through PHP_CodeSniffer and is available through Packagist for easy installation in any PHP project.