Download the PHP package vishwac09/extended-php-guidelines without Composer
On this page you can find all versions of the php package vishwac09/extended-php-guidelines. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vishwac09/extended-php-guidelines
More information about vishwac09/extended-php-guidelines
Files in vishwac09/extended-php-guidelines
Package extended-php-guidelines
Short Description Provides set of additional coding/style guidelines to sniff PHP code.
License GPL-2.0+
Informations about the package extended-php-guidelines
Extended PHP Guidelines
Apart from the PSR-1, PSR-2, PSR-12 and the Drupal standard's, we follow few more to achieve consistency of code project wide.
I work mostly on Drupal projects, so normally use the Drupal Coding standard to sniff the custom code for any violations. This PHP library is a type of PHP-CodeSniffer standard which checks PHP code against the below list.
List
- Order of imports -
Group Drupal/Symfony imports and third party libraries added via composer separately.
- Avoid Switch case -
PHP >= 8.0 provides match() {} expression, can be replaced in place of switch() case:.
- Avoid Static Class references -
Cannot be injected.
- Order of member functions -
Order member function in ascending order, improves readability.
Usage
Create a project, and add this packages as DEV dependancy.
Installation
Add via composer as local dependencies
OR
Add via composer as global dependencies
Add via GIT
add the standard to phpcs
Run
Check if the new stanadard is configures with phpcs.
Sniff code for the above violation.
Example
All versions of extended-php-guidelines with dependencies
ext-mbstring Version *
dealerdirect/phpcodesniffer-composer-installer Version ^0.7.1
squizlabs/php_codesniffer Version ^3.6.0