Skip to content

Commit

Permalink
#127 - spaces inside parentheses fixer (#129)
Browse files Browse the repository at this point in the history
#127 - feat: added spaces inside parentheses fixer
  • Loading branch information
kamilpiech97 authored Aug 2, 2024
1 parent a1acc0d commit aecc480
Show file tree
Hide file tree
Showing 4 changed files with 15 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 @@ -113,6 +113,7 @@
use PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer;
use PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer;
use PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer;
use PhpCsFixer\Fixer\Whitespace\SpacesInsideParenthesesFixer;
use PhpCsFixer\Fixer\Whitespace\StatementIndentationFixer;
use PhpCsFixer\Fixer\Whitespace\TypeDeclarationSpacesFixer;
use PhpCsFixerCustomFixers\Fixer\CommentedOutFunctionFixer;
Expand Down Expand Up @@ -346,5 +347,6 @@ class CommonRules extends Rules
NoBlankLinesAfterPhpdocFixer::class => true,
ConstantCaseFixer::class => true,
PhpUnitAttributesFixer::class => true,
SpacesInsideParenthesesFixer::class => true,
];
}
1 change: 1 addition & 0 deletions tests/codestyle/CommonRulesetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public static function providePhp80Fixtures(): array
["noMultilineWhitespaceAroundDoubleArrow"],
["compactArray"],
["classesImport"],
["spacesInsideParentheses"],
];
}

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

declare(strict_types=1);

$foo = explode("\\", $class );
$baz = [ "foo", "bar" , "baz" ];
6 changes: 6 additions & 0 deletions tests/fixtures/spacesInsideParentheses/expected.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

declare(strict_types=1);

$foo = explode("\\", $class);
$baz = ["foo", "bar", "baz"];

0 comments on commit aecc480

Please sign in to comment.