Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add blank lines before returns and after control statements #32

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

## 1.2.4 - TBA
## 1.3.0 - TBA

### Changed
* `trailing_comma_in_multiline`: Add a trailing comma to multline function parameters
* `MultilinePromotedPropertiesFixer`: Break promoted properties on multiple lines
* `ErickSkrauch/blank_line_before_return`: Add a blank line before each return
* `ErickSkrauch/line_break_after_statements`: Add a blank line after all control statements

## 1.2.3 - 2024-08-23
### Changed
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"require": {
"php": "^7.3|^8.0",
"php-cs-fixer/shim": "^3.17",
"kubawerlos/php-cs-fixer-custom-fixers": "^3.22"
"kubawerlos/php-cs-fixer-custom-fixers": "^3.22",
"erickskrauch/php-cs-fixer-custom-fixers": "^1.3"
},
"license": "MIT",
"authors": [
Expand Down
3 changes: 3 additions & 0 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public function __construct($name = 'default') {
parent::__construct($name);
$this->setIndent("\t");
$this->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers());
$this->registerCustomFixers(new \ErickSkrauch\PhpCsFixer\Fixers());
}

public function getRules() : array {
Expand Down Expand Up @@ -76,6 +77,8 @@ public function getRules() : array {
],
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
PhpCsFixerCustomFixers\Fixer\MultilinePromotedPropertiesFixer::name() => true,
'ErickSkrauch/blank_line_before_return' => true,
'ErickSkrauch/line_break_after_statements' => true,
];
}
}
Loading