-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodingStyle] Handle too detailed pair class string array on VarConst…
…antCommentRector (#897) * [CodingStyle] Handle pair class string array on VarConstantCommentRector * [CodingStyle] Handle pair class string array on VarConstantCommentRector * too detailed * Fixed 🎉 * Fixed 🎉 * phpstan * phpstan * rename fixture
- Loading branch information
1 parent
74386d2
commit 1e3e5df
Showing
4 changed files
with
118 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...gStyle/Rector/ClassConst/VarConstantCommentRector/Fixture/pair_class_string_array.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\ClassConst\VarConstantCommentRector\Fixture; | ||
|
||
class PairClassStringArray | ||
{ | ||
private const CLASSES = [ | ||
\stdClass::class => PairClassStringArray::class, | ||
]; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\ClassConst\VarConstantCommentRector\Fixture; | ||
|
||
class PairClassStringArray | ||
{ | ||
/** | ||
* @var array<string, class-string<\Rector\Tests\CodingStyle\Rector\ClassConst\VarConstantCommentRector\Fixture\PairClassStringArray>> | ||
*/ | ||
private const CLASSES = [ | ||
\stdClass::class => PairClassStringArray::class, | ||
]; | ||
} | ||
|
||
?> |
52 changes: 52 additions & 0 deletions
52
...ctor/ClassConst/VarConstantCommentRector/Fixture/pair_class_string_array_too_many.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\ClassConst\VarConstantCommentRector\Fixture; | ||
|
||
class A { } | ||
class Aa { } | ||
class B { } | ||
class Bb { } | ||
class C { } | ||
class Cc { } | ||
class D { } | ||
class Dd { } | ||
|
||
class PairClassStringArrayTooMany | ||
{ | ||
private const CLASSES = [ | ||
A::class => Aa::class, | ||
B::class => Bb::class, | ||
C::class => Cc::class, | ||
D::class => Dd::class, | ||
]; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\ClassConst\VarConstantCommentRector\Fixture; | ||
|
||
class A { } | ||
class Aa { } | ||
class B { } | ||
class Bb { } | ||
class C { } | ||
class Cc { } | ||
class D { } | ||
class Dd { } | ||
|
||
class PairClassStringArrayTooMany | ||
{ | ||
/** | ||
* @var array<string, class-string> | ||
*/ | ||
private const CLASSES = [ | ||
A::class => Aa::class, | ||
B::class => Bb::class, | ||
C::class => Cc::class, | ||
D::class => Dd::class, | ||
]; | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters