-
-
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.
[CodeQuality] Do not add \ on static on CallableThisArrayToAnonymousF…
…unctionRector (#1671) * Add failing test fixture for CallableThisArrayToAnonymousFunctionRector # Failing Test for CallableThisArrayToAnonymousFunctionRector Based on https://getrector.org/demo/1ec74754-9153-677e-92f6-f53ce8cf82e4 rectorphp/rector#6935 * rename fixture * Closes #1668 * phpstan Co-authored-by: Alexander Schranz <alexander@sulu.io>
- Loading branch information
1 parent
a84d951
commit 6ea0032
Showing
2 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...y_/CallableThisArrayToAnonymousFunctionRector/Fixture/do_not_add_backslash_static.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,47 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector\Fixture; | ||
|
||
final class DoNotAddBackslashStatic | ||
{ | ||
public function run(callable $transform) | ||
{ | ||
$transform(); | ||
} | ||
|
||
public function run2() | ||
{ | ||
$this->run([static::class, 'test']); | ||
} | ||
|
||
public static function test(): void | ||
{ | ||
echo 'test'; | ||
} | ||
} | ||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector\Fixture; | ||
|
||
final class DoNotAddBackslashStatic | ||
{ | ||
public function run(callable $transform) | ||
{ | ||
$transform(); | ||
} | ||
|
||
public function run2() | ||
{ | ||
$this->run(function () : void { | ||
static::test(); | ||
}); | ||
} | ||
|
||
public static function test(): void | ||
{ | ||
echo 'test'; | ||
} | ||
} | ||
?> |
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