-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality] Refactor FixClassCaseSensitivityNameRector (#1093)
* [CodeQuality] Refactor FixClassCaseSensitivityNameRector * debug * Fixed 🎉 * skip union param type * verify * clean up * tweak * eol * phpstan * [ci-review] Rector Rectify * clean up * clean up * [ci-review] Rector Rectify * fixture skip correct class const fetch * [ci-review] Rector Rectify * rename fixture * handle union param type * fixture fix * phpstan * rectify Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
87f6d1b
commit 8895e1b
Showing
6 changed files
with
134 additions
and
5 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
13 changes: 13 additions & 0 deletions
13
...ctor/Name/FixClassCaseSensitivityNameRector/Fixture/skip_class_constfetch_correct.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,13 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Name\FixClassCaseSensitivityNameRector\Fixture; | ||
|
||
use Rector\Tests\CodeQuality\Rector\Name\FixClassCaseSensitivityNameRector\Source\MissCaseTypedClass; | ||
|
||
final class SkipClassConstFetchCorrect | ||
{ | ||
public function run() | ||
{ | ||
$fatherSon = MissCaseTypedClass::SOME_CONST; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...ity/Rector/Name/FixClassCaseSensitivityNameRector/Fixture/skip_param_type_correct.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,13 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Name\FixClassCaseSensitivityNameRector\Fixture; | ||
|
||
use Rector\Tests\CodeQuality\Rector\Name\FixClassCaseSensitivityNameRector\Source\MissCaseTypedClass; | ||
|
||
final class SkipParamTypeCorrect | ||
{ | ||
public function run(MissCaseTypedClass $misscasetypedclass) | ||
{ | ||
return $misscasetypedclass; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...ity/Rector/Name/FixClassCaseSensitivityNameRector/Fixture/skip_param_without_type.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,13 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Name\FixClassCaseSensitivityNameRector\Fixture; | ||
|
||
use Rector\Tests\CodeQuality\Rector\Name\FixClassCaseSensitivityNameRector\Source\MissCaseTypedClass; | ||
|
||
final class SkipParamWithoutType | ||
{ | ||
public function run($misscasetypedclass) | ||
{ | ||
return $misscasetypedclass; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...odeQuality/Rector/Name/FixClassCaseSensitivityNameRector/Fixture/union_param_type.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,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Name\FixClassCaseSensitivityNameRector\Fixture; | ||
|
||
use Rector\Tests\CodeQuality\Rector\Name\FixClassCaseSensitivityNameRector\Source\MissCaseTypedClass; | ||
|
||
final class UnionParamType | ||
{ | ||
public function run(string|misscasetypedclass $misscasetypedclass) | ||
{ | ||
return $misscasetypedclass; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Name\FixClassCaseSensitivityNameRector\Fixture; | ||
|
||
use Rector\Tests\CodeQuality\Rector\Name\FixClassCaseSensitivityNameRector\Source\MissCaseTypedClass; | ||
|
||
final class UnionParamType | ||
{ | ||
public function run(string|\Rector\Tests\CodeQuality\Rector\Name\FixClassCaseSensitivityNameRector\Source\MissCaseTypedClass $misscasetypedclass) | ||
{ | ||
return $misscasetypedclass; | ||
} | ||
} | ||
|
||
?> |
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