Skip to content

Commit f632f73

Browse files
authored
rename FirstClassCallableRector to ArrayToFirstClassCallableRector to make feature explicit (#7735)
1 parent 89c84c4 commit f632f73

31 files changed

+65
-71
lines changed

config/set/php81.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Rector\CodingStyle\Rector\FuncCall\FunctionFirstClassCallableRector;
77
use Rector\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector;
88
use Rector\Config\RectorConfig;
9-
use Rector\Php81\Rector\Array_\FirstClassCallableRector;
9+
use Rector\Php81\Rector\Array_\ArrayToFirstClassCallableRector;
1010
use Rector\Php81\Rector\Class_\MyCLabsClassToEnumRector;
1111
use Rector\Php81\Rector\Class_\SpatieEnumClassToEnumRector;
1212
use Rector\Php81\Rector\ClassMethod\NewInInitializerRector;
@@ -31,7 +31,7 @@
3131
NullToStrictStringFuncCallArgRector::class,
3232
NullToStrictIntPregSlitFuncCallLimitArgRector::class,
3333
// array of local method call
34-
FirstClassCallableRector::class,
34+
ArrayToFirstClassCallableRector::class,
3535
// closure/arrow function
3636
FunctionLikeToFirstClassCallableRector::class,
3737
ClosureFromCallableToFirstClassCallableRector::class,

rules-tests/Php81/Rector/Array_/FirstClassCallableRector/FirstClassCallableRectorTest.php renamed to rules-tests/Php81/Rector/Array_/ArrayToFirstClassCallableRector/ArrayToFirstClassCallableRectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
declare(strict_types=1);
44

5-
namespace Rector\Tests\Php81\Rector\Array_\FirstClassCallableRector;
5+
namespace Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector;
66

77
use Iterator;
88
use PHPUnit\Framework\Attributes\DataProvider;
99
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
1010

11-
final class FirstClassCallableRectorTest extends AbstractRectorTestCase
11+
final class ArrayToFirstClassCallableRectorTest extends AbstractRectorTestCase
1212
{
1313
#[DataProvider('provideData')]
1414
public function test(string $filePath): void

rules-tests/Php81/Rector/Array_/FirstClassCallableRector/Fixture/make_other_closure_pass.php.inc renamed to rules-tests/Php81/Rector/Array_/ArrayToFirstClassCallableRector/Fixture/make_other_closure_pass.php.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace Rector\Tests\Php81\Rector\Array_\FirstClassCallableRector\Fixture;
3+
namespace Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector\Fixture;
44

55
use Rector\Tests\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector\Source\stdClass;
6-
use Rector\Tests\Php81\Rector\Array_\FirstClassCallableRector\Source\SomeExternalObject;
6+
use Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector\Source\SomeExternalObject;
77

88
return static function (stdClass $container): void {
99
$container->services()
@@ -14,10 +14,10 @@ return static function (stdClass $container): void {
1414
-----
1515
<?php
1616

17-
namespace Rector\Tests\Php81\Rector\Array_\FirstClassCallableRector\Fixture;
17+
namespace Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector\Fixture;
1818

1919
use Rector\Tests\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector\Source\stdClass;
20-
use Rector\Tests\Php81\Rector\Array_\FirstClassCallableRector\Source\SomeExternalObject;
20+
use Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector\Source\SomeExternalObject;
2121

2222
return static function (stdClass $container): void {
2323
$container->services()

rules-tests/Php81/Rector/Array_/FirstClassCallableRector/Fixture/skip_dynamic_variable2.php.inc renamed to rules-tests/Php81/Rector/Array_/ArrayToFirstClassCallableRector/Fixture/skip_dynamic_variable2.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Rector\Tests\Php81\Rector\Array_\FirstClassCallableRector\Fixture;
3+
namespace Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector\Fixture;
44

55
$variableName = 'x';
66
$index = 1;

rules-tests/Php81/Rector/Array_/FirstClassCallableRector/Fixture/skip_enum_data.php.inc renamed to rules-tests/Php81/Rector/Array_/ArrayToFirstClassCallableRector/Fixture/skip_enum_data.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Rector\Tests\Php81\Rector\Array_\FirstClassCallableRector\Fixture;
3+
namespace Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector\Fixture;
44

55
enum SkipEnumData: int {
66

rules-tests/Php81/Rector/Array_/FirstClassCallableRector/Fixture/skip_function_reference.php.inc renamed to rules-tests/Php81/Rector/Array_/ArrayToFirstClassCallableRector/Fixture/skip_function_reference.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Rector\Tests\Php81\Rector\Array_\FirstClassCallableRector\Fixture;
3+
namespace Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector\Fixture;
44

55
final class SkipFunctionReference
66
{

rules-tests/Php81/Rector/Array_/FirstClassCallableRector/Fixture/skip_in_attribute.php.inc renamed to rules-tests/Php81/Rector/Array_/ArrayToFirstClassCallableRector/Fixture/skip_in_attribute.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Rector\Tests\Php81\Rector\Array_\FirstClassCallableRector\Fixture;
3+
namespace Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector\Fixture;
44

55
function run(\Closure $closure): void
66
{
@@ -9,4 +9,4 @@ function run(\Closure $closure): void
99
run(
1010
#[SomeAttribute(['array-argument'])]
1111
fn(): null => null,
12-
);
12+
);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector\Fixture;
4+
5+
#[SomeAttribute(['array-argument'])]
6+
class SkipInAttributeClass
7+
{
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector\Fixture;
4+
5+
use Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector\Source\SomeExternalObject;
6+
7+
Route::get('verify-email', [SomeExternalObject::class, '__invoke'])
8+
->name('verification.notice');

rules-tests/Php81/Rector/Array_/FirstClassCallableRector/Fixture/skip_non_existing_method.php.inc renamed to rules-tests/Php81/Rector/Array_/ArrayToFirstClassCallableRector/Fixture/skip_non_existing_method.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Rector\Tests\Php81\Rector\Array_\FirstClassCallableRector\Fixture;
3+
namespace Rector\Tests\Php81\Rector\Array_\ArrayToFirstClassCallableRector\Fixture;
44

55
final class SkipNonExistingMethod
66
{

0 commit comments

Comments
 (0)