diff --git a/config/sets/laravel90.php b/config/sets/laravel90.php index afd8a998..23576519 100644 --- a/config/sets/laravel90.php +++ b/config/sets/laravel90.php @@ -3,7 +3,7 @@ declare(strict_types=1); use Rector\Arguments\Rector\ClassMethod\ArgumentAdderRector; -use Rector\Arguments\ValueObject\ArgumentAdder; +use Rector\Arguments\ValueObject\ArgumentAdderWithoutDefaultValue; use Rector\Config\RectorConfig; use Rector\Renaming\Rector\MethodCall\RenameMethodRector; use Rector\Renaming\ValueObject\MethodCallRename; @@ -19,29 +19,27 @@ // https://github.com/laravel/framework/commit/8f9ddea4481717943ed4ecff96d86b703c81a87d $rectorConfig - ->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdder( + ->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdderWithoutDefaultValue( 'Illuminate\Contracts\Foundation\Application', 'storagePath', 0, 'path', - '' ), ]); // https://github.com/laravel/framework/commit/e6c8aaea886d35cc55bd3469f1a95ad56d53e474 $rectorConfig - ->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdder( + ->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdderWithoutDefaultValue( 'Illuminate\Foundation\Application', 'langPath', 0, 'path', - '' ), ]); // https://github.com/laravel/framework/commit/e095ac0e928b5620f33c9b60816fde5ece867d32 $rectorConfig - ->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdder( + ->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdderWithoutDefaultValue( 'Illuminate\Database\Eloquent\Model', 'touch', 0, @@ -51,7 +49,7 @@ // https://github.com/laravel/framework/commit/6daecf43dd931dc503e410645ff4a7d611e3371f $rectorConfig - ->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdder( + ->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdderWithoutDefaultValue( 'Illuminate\Queue\Failed\FailedJobProviderInterface', 'flush', 0, diff --git a/stubs/Illuminate/Foundation/Application.php b/stubs/Illuminate/Foundation/Application.php new file mode 100644 index 00000000..5ea67dd0 --- /dev/null +++ b/stubs/Illuminate/Foundation/Application.php @@ -0,0 +1,13 @@ +app->langPath(); + } +} + +?> diff --git a/tests/Sets/Laravel90/Fixture/application_storage_path_new_attribute.php.inc b/tests/Sets/Laravel90/Fixture/application_storage_path_new_attribute.php.inc new file mode 100644 index 00000000..18b028fd --- /dev/null +++ b/tests/Sets/Laravel90/Fixture/application_storage_path_new_attribute.php.inc @@ -0,0 +1,17 @@ +app->storagePath(); + } +} + +?> diff --git a/tests/Sets/Laravel90/Fixture/exceptions_handler_ignore_with_public_visibility.php.inc b/tests/Sets/Laravel90/Fixture/exceptions_handler_ignore_with_public_visibility.php.inc new file mode 100644 index 00000000..6b48fa59 --- /dev/null +++ b/tests/Sets/Laravel90/Fixture/exceptions_handler_ignore_with_public_visibility.php.inc @@ -0,0 +1,29 @@ + +----- + diff --git a/tests/Sets/Laravel90/Fixture/failed_job_provider_interface_new_attribute.php.inc b/tests/Sets/Laravel90/Fixture/failed_job_provider_interface_new_attribute.php.inc new file mode 100644 index 00000000..5efa8f42 --- /dev/null +++ b/tests/Sets/Laravel90/Fixture/failed_job_provider_interface_new_attribute.php.inc @@ -0,0 +1,18 @@ +flush(); +$provider->flush(10); + +?> diff --git a/tests/Sets/Laravel90/Fixture/method_renames.php.inc b/tests/Sets/Laravel90/Fixture/method_renames.php.inc new file mode 100644 index 00000000..7a184c69 --- /dev/null +++ b/tests/Sets/Laravel90/Fixture/method_renames.php.inc @@ -0,0 +1,53 @@ +reduceWithKeys(fn () => null); +(new Collection())->reduceMany(fn () => null); + +(new Message())->getSwiftMessage(); +(new Mailable())->withSwiftMessage(); +(new MailMessage())->withSwiftMessage(); +(new Mailer())->getSwiftMailer(); +(new Mailer())->setSwiftMailer(); +(new MailManager())->createTransport(); + +(new TestResponse())->assertDeleted(null); + +?> +----- +reduce(fn () => null); +(new Collection())->reduceSpread(fn () => null); + +(new Message())->getSymfonyMessage(); +(new Mailable())->withSymfonyMessage(); +(new MailMessage())->withSymfonyMessage(); +(new Mailer())->getSymfonyTransport(); +(new Mailer())->setSymfonyTransport(); +(new MailManager())->createSymfonyTransport(); + +(new TestResponse())->assertModelMissing(null); + +?> diff --git a/tests/Sets/Laravel90/Fixture/model_touch_new_attribute.php.inc b/tests/Sets/Laravel90/Fixture/model_touch_new_attribute.php.inc new file mode 100644 index 00000000..9ff15fd6 --- /dev/null +++ b/tests/Sets/Laravel90/Fixture/model_touch_new_attribute.php.inc @@ -0,0 +1,12 @@ +touch(); + +?> diff --git a/tests/Sets/Laravel90/Laravel90Test.php b/tests/Sets/Laravel90/Laravel90Test.php new file mode 100644 index 00000000..109b353e --- /dev/null +++ b/tests/Sets/Laravel90/Laravel90Test.php @@ -0,0 +1,31 @@ +doTestFile($filePath); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config/configured_rule.php'; + } +} diff --git a/tests/Sets/Laravel90/Source/Collection.php b/tests/Sets/Laravel90/Source/Collection.php new file mode 100644 index 00000000..8475973e --- /dev/null +++ b/tests/Sets/Laravel90/Source/Collection.php @@ -0,0 +1,9 @@ +import(__DIR__ . '/../../../../config/sets/laravel90.php'); +};