-
-
Notifications
You must be signed in to change notification settings - Fork 742
Closed
rectorphp/rector-src
#4554Labels
Description
Feature Request
I'd like to use ReplaceArgumentDefaultValueRector to make changes on __construct calls.
Given a class like this:
class SomeClass
{
public const CONSTANT = 'const_value';
public function __construct(string $arg) { /* ... */ }
}The rule with this config has no effect:
$rectorConfig->ruleWithConfiguration(ReplaceArgumentDefaultValueRector::class, [
new ReplaceArgumentDefaultValue('SomeClass', '__construct', 0, 'const_value', 'SomeClass::CONSTANT'),
]);Diff
I'd like to make this change:
-$someObject = new SomeClass('const_value');
+$someObject = new SomeClass(SomeClass::CONSTANT);Reactions are currently unavailable