PHPCompatibility

(( gitHubWatchers )) (( gitHubStars )) (( gitHubForks ))

PHPCompatibility is a set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.

It will allow you to analyse your code for compatibility with higher and lower versions of PHP.

Installation

Install from a Composer package as a dev dependency (with Composer)

Make sure you have Composer installed.

Require it as a dev dependency:
composer require --dev phpcompatibility/php-compatibility
Inform PHPCS about the new standard:
php vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility/PHPCompatibility
Run it:
php vendor/bin/phpcs --standard=PHPCompatibility