Skip to content

Commit

Permalink
#94 - added blank line fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilpiech97 committed Jun 16, 2023
1 parent f858620 commit 354c5ed
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Configuration/Defaults/CommonRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
use PhpCsFixer\Fixer\Strict\StrictParamFixer;
use PhpCsFixer\Fixer\StringNotation\SimpleToComplexStringVariableFixer;
use PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer;
use PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer;
use PhpCsFixer\Fixer\Whitespace\BlankLineBetweenImportGroupsFixer;
use PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer;
use PhpCsFixer\Fixer\Whitespace\LineEndingFixer;
Expand Down Expand Up @@ -304,5 +305,6 @@ class CommonRules extends Rules
LineEndingFixer::class => true,
StatementIndentationFixer::class => true,
BlankLineBetweenImportGroupsFixer::class => true,
BlankLineBeforeStatementFixer::class => true,
];
}
1 change: 1 addition & 0 deletions tests/codestyle/CommonRulesetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public static function providePhp80Fixtures(): array
["namespaces"],
["emptyLines"],
["importsOrder"],
["blankLineBeforeStatement"],
];
}

Expand Down
11 changes: 11 additions & 0 deletions tests/codestyle/fixtures/blankLineBeforeStatement/actual.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

class BlankLine
{
public function getFoo(int $foo): int {
$bar = $foo;
return $bar;
}
}
12 changes: 12 additions & 0 deletions tests/codestyle/fixtures/blankLineBeforeStatement/expected.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

class BlankLine
{
public function getFoo(int $foo): int {
$bar = $foo;

return $bar;
}
}

0 comments on commit 354c5ed

Please sign in to comment.