Skip to content

Commit 3add8a4

Browse files
✨ Add space after : and ,
1 parent 1e0b74f commit 3add8a4

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

SymfonyCustom/Sniffs/NamingConventions/ValidScalarTypeNameSniff.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ private function getValidTypeName(string $typeName): string
9292
$validType = '';
9393
for ($i = 0; $i < $partsNumber; $i += 2) {
9494
$validType .= $this->suggestType($parts[$i]).$parts[$i + 1];
95+
96+
if (in_array($parts[$i + 1], [',', ':'])) {
97+
$validType .= ' ';
98+
}
9599
}
96100

97101
if ('' !== $parts[$partsNumber]) {

SymfonyCustom/Tests/NamingConventions/ValidScalarTypeNameUnitTest.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ echo ( float ) $a;
4545
/** @method integer|string */
4646
/** @method array<integer,boolean>|integer[]|array<integer> truc */
4747
/** @method array<integer, boolean>| integer[] |string|(integer|boolean)[] truc */
48+
/** @method array{scheme:string,host:string} truc */

SymfonyCustom/Tests/NamingConventions/ValidScalarTypeNameUnitTest.inc.fixed

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ echo ( float ) $a;
4343
/** @var float $c */
4444

4545
/** @method int|string */
46-
/** @method array<int,bool>|int[]|array<int> truc */
47-
/** @method array<int,bool>|int[]|string|(int|bool)[] truc */
46+
/** @method array<int, bool>|int[]|array<int> truc */
47+
/** @method array<int, bool>|int[]|string|(int|bool)[] truc */
48+
/** @method array{scheme: string, host: string} truc */

SymfonyCustom/Tests/NamingConventions/ValidScalarTypeNameUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ protected function getErrorList(): array
3737
45 => 1,
3838
46 => 1,
3939
47 => 1,
40+
48 => 1,
4041
];
4142
}
4243

0 commit comments

Comments
 (0)