From 970a27ad176bbbedc3c6b95a6156f6ae5e43995c Mon Sep 17 00:00:00 2001 From: Peter Fox Date: Sun, 19 Jan 2025 13:07:50 +0000 Subject: [PATCH] Rename of rule --- .../Fixture/skip_byref_usage.php.inc | 10 --------- .../skip_functions_without_calls.php.inc | 12 ---------- .../supports_varadic_and_unpack.php.inc | 22 ------------------- .../config/configured_rule.php | 9 -------- .../Fixture/fixture.php.inc | 4 ++-- .../Fixture/skip_byref_usage.php.inc | 10 +++++++++ .../skip_call_dependency_on_arg.php.inc | 2 +- .../skip_functions_with_no_return.php.inc | 2 +- ...functions_with_too_many_statements.php.inc | 2 +- .../skip_functions_without_calls.php.inc | 12 ++++++++++ .../skip_mismatched_args_and_params.php.inc | 2 +- .../Fixture/skip_named_args.php.inc | 2 +- .../supports_varadic_and_unpack.php.inc | 22 +++++++++++++++++++ ...ionLikeToFirstClassCallableRectorTest.php} | 4 ++-- .../config/configured_rule.php | 9 ++++++++ ...unctionLikeToFirstClassCallableRector.php} | 4 ++-- .../Fixture/count_to_empty_array_compare.php | 16 ++++++++++++++ 17 files changed, 80 insertions(+), 64 deletions(-) delete mode 100644 rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_byref_usage.php.inc delete mode 100644 rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_functions_without_calls.php.inc delete mode 100644 rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/supports_varadic_and_unpack.php.inc delete mode 100644 rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/config/configured_rule.php rename rules-tests/CodingStyle/Rector/FunctionLike/{FuncLikeToFirstClassCallableRector => FunctionLikeToFirstClassCallableRector}/Fixture/fixture.php.inc (68%) create mode 100644 rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/skip_byref_usage.php.inc rename rules-tests/CodingStyle/Rector/FunctionLike/{FuncLikeToFirstClassCallableRector => FunctionLikeToFirstClassCallableRector}/Fixture/skip_call_dependency_on_arg.php.inc (69%) rename rules-tests/CodingStyle/Rector/FunctionLike/{FuncLikeToFirstClassCallableRector => FunctionLikeToFirstClassCallableRector}/Fixture/skip_functions_with_no_return.php.inc (54%) rename rules-tests/CodingStyle/Rector/FunctionLike/{FuncLikeToFirstClassCallableRector => FunctionLikeToFirstClassCallableRector}/Fixture/skip_functions_with_too_many_statements.php.inc (66%) create mode 100644 rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/skip_functions_without_calls.php.inc rename rules-tests/CodingStyle/Rector/FunctionLike/{FuncLikeToFirstClassCallableRector => FunctionLikeToFirstClassCallableRector}/Fixture/skip_mismatched_args_and_params.php.inc (71%) rename rules-tests/CodingStyle/Rector/FunctionLike/{FuncLikeToFirstClassCallableRector => FunctionLikeToFirstClassCallableRector}/Fixture/skip_named_args.php.inc (58%) create mode 100644 rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/supports_varadic_and_unpack.php.inc rename rules-tests/CodingStyle/Rector/FunctionLike/{FuncLikeToFirstClassCallableRector/FuncLikeToFirstClassCallableRectorTest.php => FunctionLikeToFirstClassCallableRector/FunctionLikeToFirstClassCallableRectorTest.php} (74%) create mode 100644 rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/config/configured_rule.php rename rules/CodingStyle/Rector/FunctionLike/{FuncLikeToFirstClassCallableRector.php => FunctionLikeToFirstClassCallableRector.php} (96%) create mode 100644 tests/Issues/CountArrayLongToShort/Fixture/count_to_empty_array_compare.php diff --git a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_byref_usage.php.inc b/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_byref_usage.php.inc deleted file mode 100644 index 37375bb72d5..00000000000 --- a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_byref_usage.php.inc +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_functions_without_calls.php.inc b/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_functions_without_calls.php.inc deleted file mode 100644 index cc58cafaca7..00000000000 --- a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_functions_without_calls.php.inc +++ /dev/null @@ -1,12 +0,0 @@ - $foo; - -?> diff --git a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/supports_varadic_and_unpack.php.inc b/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/supports_varadic_and_unpack.php.inc deleted file mode 100644 index 027591aca0a..00000000000 --- a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/supports_varadic_and_unpack.php.inc +++ /dev/null @@ -1,22 +0,0 @@ - FooBar::foo(...$foo); - -?> ------ - diff --git a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/config/configured_rule.php b/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/config/configured_rule.php deleted file mode 100644 index f393f771220..00000000000 --- a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/config/configured_rule.php +++ /dev/null @@ -1,9 +0,0 @@ -withRules([FuncLikeToFirstClassCallableRector::class]); diff --git a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/fixture.php.inc b/rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/fixture.php.inc similarity index 68% rename from rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/fixture.php.inc rename to rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/fixture.php.inc index d8c2497cf7d..826ee48c6b3 100644 --- a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/fixture.php.inc +++ b/rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/fixture.php.inc @@ -1,6 +1,6 @@ FooBar::foo($foo); ----- diff --git a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_call_dependency_on_arg.php.inc b/rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/skip_call_dependency_on_arg.php.inc similarity index 69% rename from rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_call_dependency_on_arg.php.inc rename to rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/skip_call_dependency_on_arg.php.inc index a2685221741..b00a25bf272 100644 --- a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_call_dependency_on_arg.php.inc +++ b/rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/skip_call_dependency_on_arg.php.inc @@ -1,6 +1,6 @@ $foo; + +?> diff --git a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_mismatched_args_and_params.php.inc b/rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/skip_mismatched_args_and_params.php.inc similarity index 71% rename from rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_mismatched_args_and_params.php.inc rename to rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/skip_mismatched_args_and_params.php.inc index 7bafeb9751c..d7b5d0b6314 100644 --- a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/Fixture/skip_mismatched_args_and_params.php.inc +++ b/rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/Fixture/skip_mismatched_args_and_params.php.inc @@ -1,6 +1,6 @@ FooBar::foo(...$foo); + +?> +----- + diff --git a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/FuncLikeToFirstClassCallableRectorTest.php b/rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/FunctionLikeToFirstClassCallableRectorTest.php similarity index 74% rename from rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/FuncLikeToFirstClassCallableRectorTest.php rename to rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/FunctionLikeToFirstClassCallableRectorTest.php index 5876bd134e3..4a7409804f0 100644 --- a/rules-tests/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector/FuncLikeToFirstClassCallableRectorTest.php +++ b/rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/FunctionLikeToFirstClassCallableRectorTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Rector\Tests\CodingStyle\Rector\FunctionLike\FuncLikeToFirstClassCallableRector; +namespace Rector\Tests\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector; use Iterator; use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; -final class FuncLikeToFirstClassCallableRectorTest extends AbstractRectorTestCase +final class FunctionLikeToFirstClassCallableRectorTest extends AbstractRectorTestCase { #[DataProvider('provideData')] public function test(string $filePath): void diff --git a/rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/config/configured_rule.php b/rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/config/configured_rule.php new file mode 100644 index 00000000000..0a8dd0b84a6 --- /dev/null +++ b/rules-tests/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector/config/configured_rule.php @@ -0,0 +1,9 @@ +withRules([FunctionLikeToFirstClassCallableRector::class]); diff --git a/rules/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector.php b/rules/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector.php similarity index 96% rename from rules/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector.php rename to rules/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector.php index a7005552134..7b75ee46877 100644 --- a/rules/CodingStyle/Rector/FunctionLike/FuncLikeToFirstClassCallableRector.php +++ b/rules/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector.php @@ -20,9 +20,9 @@ use Webmozart\Assert\Assert; /** - * @see \Rector\Tests\CodingStyle\Rector\FunctionLike\FuncLikeToFirstClassCallableRector\FuncLikeToFirstClassCallableRectorTest + * @see \Rector\Tests\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector\FunctionLikeToFirstClassCallableRectorTest */ -final class FuncLikeToFirstClassCallableRector extends AbstractRector +final class FunctionLikeToFirstClassCallableRector extends AbstractRector { public function getRuleDefinition(): RuleDefinition { diff --git a/tests/Issues/CountArrayLongToShort/Fixture/count_to_empty_array_compare.php b/tests/Issues/CountArrayLongToShort/Fixture/count_to_empty_array_compare.php new file mode 100644 index 00000000000..a1401e08023 --- /dev/null +++ b/tests/Issues/CountArrayLongToShort/Fixture/count_to_empty_array_compare.php @@ -0,0 +1,16 @@ +