-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move LocallyCalledStaticMethodToNonStaticRector to CodeQuality namesp…
…ace, to avoid dumping removed static set (#4242)
- Loading branch information
1 parent
a8339a3
commit e87ee7e
Showing
20 changed files
with
139 additions
and
133 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
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
39 changes: 39 additions & 0 deletions
39
...r/ClassMethod/LocallyCalledStaticMethodToNonStaticRector/Fixture/case_with_parent.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,39 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector\Fixture; | ||
|
||
use Rector\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector\Source\SomeParent; | ||
|
||
class CaseWithParent extends SomeParent | ||
{ | ||
private static function someStatic() | ||
{ | ||
} | ||
|
||
public function run() | ||
{ | ||
self::someStatic(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector\Fixture; | ||
|
||
use Rector\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector\Source\SomeParent; | ||
|
||
class CaseWithParent extends SomeParent | ||
{ | ||
private function someStatic() | ||
{ | ||
} | ||
|
||
public function run() | ||
{ | ||
$this->someStatic(); | ||
} | ||
} | ||
|
||
?> |
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
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
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
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
18 changes: 18 additions & 0 deletions
18
...or/ClassMethod/LocallyCalledStaticMethodToNonStaticRector/Fixture/skip_else_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,18 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector\Fixture; | ||
|
||
class SkipElseClass | ||
{ | ||
public function run() | ||
{ | ||
\Rector\Tests\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector\Fixture\AnotherClass::someStatic(); | ||
} | ||
} | ||
|
||
class AnotherClass | ||
{ | ||
public static function someStatic() | ||
{ | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...tor/Fixture/skip_event_subscriber.php.inc → ...tor/Fixture/skip_event_subscriber.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
23 changes: 23 additions & 0 deletions
23
...thod/LocallyCalledStaticMethodToNonStaticRector/Fixture/skip_local_and_else_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,23 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector\Fixture; | ||
|
||
class SkipLocalAndElseClass | ||
{ | ||
public function run() | ||
{ | ||
\Rector\Tests\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector\Fixture\YetAnotherClass::someStatic(); | ||
} | ||
} | ||
|
||
class YetAnotherClass | ||
{ | ||
public static function someStatic() | ||
{ | ||
self::callHere(); | ||
} | ||
|
||
public function callHere() | ||
{ | ||
} | ||
} |
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
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
9 changes: 9 additions & 0 deletions
9
...ality/Rector/ClassMethod/LocallyCalledStaticMethodToNonStaticRector/Source/SomeParent.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,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector\Source; | ||
|
||
abstract class SomeParent | ||
{ | ||
} |
10 changes: 10 additions & 0 deletions
10
.../Rector/ClassMethod/LocallyCalledStaticMethodToNonStaticRector/config/configured_rule.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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector; | ||
use Rector\Config\RectorConfig; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->rule(LocallyCalledStaticMethodToNonStaticRector::class); | ||
}; |
39 changes: 0 additions & 39 deletions
39
...r/ClassMethod/LocallyCalledStaticMethodToNonStaticRector/Fixture/case_with_parent.php.inc
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
...or/ClassMethod/LocallyCalledStaticMethodToNonStaticRector/Fixture/skip_else_class.php.inc
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
...thod/LocallyCalledStaticMethodToNonStaticRector/Fixture/skip_local_and_else_class.php.inc
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...tatic/Rector/ClassMethod/LocallyCalledStaticMethodToNonStaticRector/Source/SomeParent.php
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.