Download the PHP package geolid/phpcs without Composer
On this page you can find all versions of the php package geolid/phpcs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Vendor geolid
Package phpcs
Short Description Official Geolid coding standard.
License MIT
Homepage https://github.com/Geolid/phpcs
Package phpcs
Short Description Official Geolid coding standard.
License MIT
Homepage https://github.com/Geolid/phpcs
Please rate this library. Is it a good library?
Informations about the package phpcs
Geolid PHP Coding Style
PHPCS ruleset used at Geolid.
Installation
composer require --dev geolid/phpcs
You only need this package, no need to require manually squizlabs/php_codesniffer
or friendsofphp/php-cs-fixer
.
After require, copy in your path : phpcs.xml.dist
and rename to phpcs.xml̀
or add the rule below in your existing phpcs.xml
.
Copy in your path the .php_cs.dist
file.
Usage
Use php_codesniffer normally.
vendor/bin/phpcs
Use php-cs-fixer normally.
vendor/bin/php-cs-fixer fix
Description
We follow the PSR-2 coding style with additional rules.
Additional rules :
code quality
- Add leading \ before function invocation to speed up resolving.
- Parameters with a default null value needs ? before type declarations.
- No unused imports (
use
statements). - Php must contains with one blank line between declaration and php open tag.
- No more 3 nesting identation levels.
readability
- Array must be in short syntax.
- One space around concatenation operator.
- One space after casting operator.
- Object instantiation must always be with parentheses.
- Must have blank line before return statement.
-
Must have one space before return typehint.
- Only one use per line for traits.
- No empty phpdoc
PR readability
- Trailing comma : multiline arrays must have comma in all line.
- Trailing comma : multiline call must have comma in all line.
naming
- Prefix all abstract classes with Abstract except PHPUnit *TestCase. (name of empty abstract not detected for moment).
- Suffix interfaces with Interface.
- Suffix traits with Trait.
- Suffix exceptions with Exception.
PSR-12
- Visibility MUST be declared on all constants.
- Private methods and properties MUST not be prefixed with an underscore.
Testing
composer test
All versions of phpcs with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.3|^8.0
escapestudios/symfony2-coding-standard Version ^3.10
friendsofphp/php-cs-fixer Version ^3.2.1
slevomat/coding-standard Version ^7.0.16
squizlabs/php_codesniffer Version ^3.5.3
escapestudios/symfony2-coding-standard Version ^3.10
friendsofphp/php-cs-fixer Version ^3.2.1
slevomat/coding-standard Version ^7.0.16
squizlabs/php_codesniffer Version ^3.5.3
The package geolid/phpcs contains the following files
Loading the files please wait ....