Skip to content

Conversation

@zingimmick
Copy link
Contributor

@zingimmick zingimmick commented Mar 26, 2021

When I follow the instructions to configure ArgumentAdderRector

use Rector\Arguments\Rector\ClassMethod\ArgumentAdderRector;
use Rector\Arguments\ValueObject\ArgumentAdder;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\SymfonyPhpConfig\ValueObjectInliner;

return static function (ContainerConfigurator $containerConfigurator): void {
    $services = $containerConfigurator->services();

    $services->set(ArgumentAdderRector::class)
        ->call('configure', [[
ArgumentAdderRector::ADDED_ARGUMENTS => ValueObjectInliner::inline([
    new ArgumentAdder('SomeExampleClass', 'someMethod', 0, 'someArgument', 'true', 'SomeType', null),
    ]),
]]);
};

What did Rector change?

 $someObject = new SomeExampleClass;
-$someObject->someMethod();
+$someObject->someMethod('true');

Expected Behavior

 $someObject = new SomeExampleClass;
-$someObject->someMethod();
+$someObject->someMethod(true);

@samsonasik
Copy link
Member

Thank you @zingimmick

TomasVotruba added a commit that referenced this pull request Jun 21, 2024
rectorphp/rector-src@69c35a5 [ci] Remove missing-in-set as too robust, set are not bound to namespace (#5997)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants