-
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
80 additions
and
64 deletions.
There are no files selected for viewing
10 changes: 0 additions & 10 deletions
10
...e/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_byref_usage.php.inc
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
...ctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_functions_without_calls.php.inc
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
...nctionLike/FuncLikeToFirstClassCallableRector/Fixture/supports_varadic_and_unpack.php.inc
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...ngStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/config/configured_rule.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
10 changes: 10 additions & 0 deletions
10
...ctor/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/skip_byref_usage.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,10 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector\Fixture; | ||
|
||
function (&$foo) | ||
{ | ||
return Foo::foo($foo); | ||
}; | ||
|
||
?> |
2 changes: 1 addition & 1 deletion
2
...xture/skip_call_dependency_on_arg.php.inc → ...xture/skip_call_dependency_on_arg.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
2 changes: 1 addition & 1 deletion
2
...ure/skip_functions_with_no_return.php.inc → ...ure/skip_functions_with_no_return.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
2 changes: 1 addition & 1 deletion
2
...unctions_with_too_many_statements.php.inc → ...unctions_with_too_many_statements.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
12 changes: 12 additions & 0 deletions
12
...nLike/FunctionLikeToFirstClassCallableRector/Fixture/skip_functions_without_calls.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,12 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector\Fixture; | ||
|
||
function ($foo) | ||
{ | ||
return $foo; | ||
}; | ||
|
||
fn ($foo) => $foo; | ||
|
||
?> |
2 changes: 1 addition & 1 deletion
2
...e/skip_mismatched_args_and_params.php.inc → ...e/skip_mismatched_args_and_params.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
2 changes: 1 addition & 1 deletion
2
...bleRector/Fixture/skip_named_args.php.inc → ...bleRector/Fixture/skip_named_args.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
22 changes: 22 additions & 0 deletions
22
...onLike/FunctionLikeToFirstClassCallableRector/Fixture/supports_varadic_and_unpack.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,22 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector\Fixture; | ||
|
||
function (...$foo) | ||
{ | ||
return FooBar::foo(...$foo); | ||
}; | ||
|
||
fn (...$foo) => FooBar::foo(...$foo); | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector\Fixture; | ||
|
||
FooBar::foo(...); | ||
|
||
FooBar::foo(...); | ||
|
||
?> |
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
...yle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/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,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector; | ||
use Rector\Config\RectorConfig; | ||
|
||
return RectorConfig::configure() | ||
->withRules([FunctionLikeToFirstClassCallableRector::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
16 changes: 16 additions & 0 deletions
16
tests/Issues/CountArrayLongToShort/Fixture/count_to_empty_array_compare.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,16 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Issues\CountArrayLongToShort\Fixture; | ||
|
||
final class CountToEmptyArrayCompare | ||
{ | ||
public function run() | ||
{ | ||
$data = []; | ||
|
||
if (count($data) === 0) { | ||
} | ||
} | ||
} | ||
|
||
?> |