Download the PHP package bondforge/coding-standard without Composer
On this page you can find all versions of the php package bondforge/coding-standard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bondforge/coding-standard
More information about bondforge/coding-standard
Files in bondforge/coding-standard
Package coding-standard
Short Description Shared PHP CS Fixer configuration and custom fixers for BondForge projects.
License MIT
Informations about the package coding-standard
bondforge/coding-standard
Shared PHP CS Fixer configuration and custom fixers for BondForge projects.
The headline feature is the BondForge/braces_position fixer — a superset of
php-cs-fixer's built-in braces_position that adds a next_line value for
functions_opening_brace, forcing the opening brace of every function and method
onto its own line (Allman style), including for multi-line signatures:
Installation
If the package is not published to Packagist, add the repository to the consuming
project's composer.json first:
Usage
Create a .php-cs-fixer.dist.php in your project root that requires the shared
config:
By default it scans bin/, public/, src/ and tests/ (whichever exist)
relative to the current working directory.
Customising the scanned paths
Define $finder before the require and the shared config will use it instead
of the default:
Then run it as usual:
The BondForge/braces_position rule
functions_opening_brace accepts a third value beyond the built-in fixer's
options:
| Value | Behaviour |
|---|---|
same_line |
Brace stays on the signature line. |
next_line_unless_newline_at_signature_end |
Brace goes to the next line, unless the signature already wraps. |
next_line (BondForge addition) |
Brace always goes to its own line, wrapped or not (Allman). |
All other options (classes_opening_brace, control_structures_opening_brace,
etc.) behave exactly like the built-in fixer and default to the same values
PSR-12 uses.
Development
License
MIT. src/Fixer/Basic/BracesPositionFixer.php is derived from php-cs-fixer's
BracesPositionFixer (© Fabien Potencier and Dariusz Rumiński, MIT). See
LICENSE.