Download the PHP package fullsmack/php-cs-fixer-breathe without Composer
On this page you can find all versions of the php package fullsmack/php-cs-fixer-breathe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fullsmack/php-cs-fixer-breathe
More information about fullsmack/php-cs-fixer-breathe
Files in fullsmack/php-cs-fixer-breathe
Package php-cs-fixer-breathe
Short Description Breathe - Custom PHP-CS-Fixer configuration with FullSmack coding standards
License MIT
Informations about the package php-cs-fixer-breathe
Breathe - PHP-CS-Fixer Configuration
Custom PHP-CS-Fixer configuration package with custom fixers and rulesets for FullSmack coding standards.
Features
This package provides:
- Custom Fixers: Custom fixers mainly for specific brace positioning
- Custom RuleSet: Pre-configured
@fullsmack/breatheruleset based on PSR-12 - Easy Integration: Simple to use in your projects
Installation
Install via Composer:
Usage
Quick Start
Create a .php-cs-fixer.dist.php file in your project root:
Manual Configuration
For more control, you can manually configure:
Extending the RuleSet
You can use the @Breathe ruleset as a base and override specific rules:
Custom Fixers
This package includes the following custom fixers:
Fullsmack/match_brace_same_line
Ensures match expression opening braces are on the same line.
Fullsmack/try_brace_same_line
Ensures try block opening braces are on the same line.
Fullsmack/catch_on_new_line
Places catch statements on a new line after the closing brace of the try block.
Fullsmack/else_on_new_line
Places else statements on a new line after the closing brace of the if block.
Fullsmack/empty_catch_body_same_line
Handles formatting of empty catch blocks.
Fullsmack/method_return_type_brace_regex
Applies regex-based formatting for method return type braces.
The @fullsmack/breathe RuleSet
The @fullsmack/breathe ruleset extends @PSR12 with additional rules:
- Custom brace positioning for control structures and functions
- Specific import handling
- Trailing comma requirements in multiline arrays and parameters
- And more...
See src/RuleSet/Breathe.php for the complete list of rules.
Running PHP-CS-Fixer
After creating your configuration file:
Requirements
- PHP 8.1 or higher
- PHP-CS-Fixer 3.92 or higher
License
MIT
Contributing
Contributions are welcome! Please submit pull requests or open issues on GitHub.