Skip to content

Commit 5b9b9a8

Browse files
authored
[ECS] Skip FunctionTypehintSpaceFixer for add space on &$variable (#1388)
* [ECS] Skip FunctionTypehintSpaceFixer for add space on &$variable * [ECS] Skip FunctionTypehintSpaceFixer for add space on &$variable
1 parent 26166bd commit 5b9b9a8

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

ecs.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
declare(strict_types=1);
44

5+
use PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer;
56
use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer;
67
use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer;
78
use PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer;
@@ -75,6 +76,13 @@
7576
'*TypeResolverTest.php',
7677
__DIR__ . '/rules-tests/CodingStyle/Node/UseManipulator/UseManipulatorTest.php',
7778
],
79+
80+
// skip add space on &$variable
81+
FunctionTypehintSpaceFixer::class => [
82+
__DIR__ . '/src/PhpParser/Printer/BetterStandardPrinter.php',
83+
__DIR__ . '/src/DependencyInjection/Loader/Configurator/RectorServiceConfigurator.php',
84+
__DIR__ . '/rules/Php70/EregToPcreTransformer.php',
85+
],
7886
]);
7987

8088
// import SetList here in the end of ecs. is on purpose

rules/Php70/EregToPcreTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ private function _ere2pcre(string $content, int $i): array
206206
/**
207207
* @param mixed[] $r
208208
*/
209-
private function processBracket(string $content, int $i, int $l, array & $r, int $rr): int
209+
private function processBracket(string $content, int $i, int $l, array &$r, int $rr): int
210210
{
211211
// special case
212212
if ($i + 1 < $l && $content[$i + 1] === ')') {
@@ -281,7 +281,7 @@ private function _ere2pcre_escape(string $content): string
281281
/**
282282
* @param mixed[] $r
283283
*/
284-
private function processCurlyBracket(string $s, int $i, array & $r, int $rr): int
284+
private function processCurlyBracket(string $s, int $i, array &$r, int $rr): int
285285
{
286286
$ii = strpos($s, '}', $i);
287287
if ($ii === false) {

src/DependencyInjection/Loader/Configurator/RectorServiceConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function configure(array $configuration): self
2323
$this->ensureClassIsConfigurable($this->id);
2424

2525
// decorate with value object inliner so Symfony understands, see https://getrector.org/blog/2020/09/07/how-to-inline-value-object-in-symfony-php-config
26-
array_walk_recursive($configuration, function (& $value) {
26+
array_walk_recursive($configuration, function (&$value) {
2727
if (is_object($value)) {
2828
$value = ValueObjectInliner::inline($value);
2929
}

src/PhpParser/Printer/BetterStandardPrinter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ protected function outdent(): void
209209
protected function pArray(
210210
array $nodes,
211211
array $origNodes,
212-
int & $pos,
212+
int &$pos,
213213
int $indentAdjustment,
214214
string $parentNodeType,
215215
string $subNodeName,

0 commit comments

Comments
 (0)