You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There doesn't seem to be a way to add a new method or function parameter without a default value. E.g.
$rectorConfig->ruleWithConfiguration(
ArgumentAdderRector::class,
[
new ArgumentAdder(
$class,
'addToGeneratorDefinition',
0,
'definition',
NULL,
new ObjectType(PropertyDefinition::class),
),
],
);
produces this change:
- public static function addToGeneratorDefinition(): PropertyDefinition {
+ public static function addToGeneratorDefinition(PropertyDefinition $definition = null): PropertyDefinition {
- public static function addToGeneratorDefinition(): PropertyDefinition {
+ public static function addToGeneratorDefinition($definition = null): PropertyDefinition {
Expected Behaviour
The text was updated successfully, but these errors were encountered:
I think to avoid ambiguosity, it need new value object: ArgumentAdderWithoutDefaultValue, so it will verify instanceof it, then don't add default value.
Bug Report
Minimal PHP Code Causing Issue
There doesn't seem to be a way to add a new method or function parameter without a default value. E.g.
produces this change:
If I remove the type and the NULL like this:
it still gets a default:
Expected Behaviour
The text was updated successfully, but these errors were encountered: