https://github.com/addiks/more-php-cs-fixers
Extension for PHP-CS-Fixer with more fixers
https://github.com/addiks/more-php-cs-fixers
codestyle extension php
Last synced: 5 months ago
JSON representation
Extension for PHP-CS-Fixer with more fixers
- Host: GitHub
- URL: https://github.com/addiks/more-php-cs-fixers
- Owner: addiks
- Created: 2019-10-20T13:06:33.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-09-29T12:57:23.000Z (over 3 years ago)
- Last Synced: 2025-02-14T13:13:04.552Z (over 1 year ago)
- Topics: codestyle, extension, php
- Language: PHP
- Size: 53.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Travis Build Status][1]][2]
[![Scrutinizer Build Status][3]][4]
[![Scrutinizer Code Quality][5]][6]
[![Code Coverage][7]][8]
# More PHP-CS-Fixer's
This repository contains a few additional fixers for the [PHP-CS-Fixer][9] project:
* Add a blank line before doc-comments
* Add a blank line before else- and elseif-codeblocks
* Add a blank line before catch- and finally-codeblocks
## Setup
### 1. Install package via composer:
```bash
composer require addiks/more-php-cs-fixers
```
### 2. Register fixers in PHP-CS-Fixer configuration (file `.php_cs`).:
```diff
registerCustomFixers([
+ new BlankLineBeforeCatchBlockFixer(),
+ new BlankLineBeforeElseBlockFixer(),
+ new BlankLineBeforeDocCommentFixer(),
+]);
+$config->setRules([
+ 'Addiks/blank_line_before_catch_block': true,
+ 'Addiks/blank_line_before_else_block': true,
+ 'Addiks/blank_line_before_doccomment': true,
+]);
return $config;
```
## The fixers
### Addiks/blank_line_before_catch_block
```diff
$foo */
```
[1]: https://travis-ci.com/addiks/more-php-cs-fixers
[2]: https://travis-ci.com/addiks/more-php-cs-fixers.svg?branch=master
[3]: https://scrutinizer-ci.com/g/addiks/more-php-cs-fixers/badges/build.png?b=master
[4]: https://scrutinizer-ci.com/g/addiks/more-php-cs-fixers/build-status/master
[5]: https://scrutinizer-ci.com/g/addiks/more-php-cs-fixers/badges/quality-score.png?b=master
[6]: https://scrutinizer-ci.com/g/addiks/more-php-cs-fixers/?branch=master
[7]: https://scrutinizer-ci.com/g/addiks/more-php-cs-fixers/badges/coverage.png?b=master
[8]: https://scrutinizer-ci.com/g/addiks/more-php-cs-fixers/?branch=master
[9]: https://github.com/FriendsOfPHP/PHP-CS-Fixer/