Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodingStyle] Skip anonymous class on MakeInheritedMethodVisibilitySa…
…meAsParentRector (#5688) * [CodingStyle] Skip anonymous class on MakeInheritedMethodVisibilitySameAsParentRector * fix
- Loading branch information
1 parent
7df4894
commit 8c52d61
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...thod/MakeInheritedMethodVisibilitySameAsParentRector/Fixture/skip_anonymous_class.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,20 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector\Fixture; | ||
|
||
use Rector\Tests\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector\Source\ParentWithProtectedMethod; | ||
|
||
class SkipAnonymousClass | ||
{ | ||
public function run() | ||
{ | ||
$obj = new class extends ParentWithProtectedMethod { | ||
public function run() | ||
{ | ||
return 1; | ||
} | ||
}; | ||
|
||
var_dump($obj->run() === 1); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...thod/MakeInheritedMethodVisibilitySameAsParentRector/Source/ParentWithProtectedMethod.php
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,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector\Source; | ||
|
||
class ParentWithProtectedMethod | ||
{ | ||
protected function run() | ||
{ | ||
} | ||
} |
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