Skip to content

[Php71] Skip magic @method on RemoveExtraParametersRector#8181

Merged
TomasVotruba merged 1 commit into
mainfrom
skip-magic-method-remove-extra-params
Jul 12, 2026
Merged

[Php71] Skip magic @method on RemoveExtraParametersRector#8181
TomasVotruba merged 1 commit into
mainfrom
skip-magic-method-remove-extra-params

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

A magic @method declared with no parameters has no real signature to compare arguments against. RemoveExtraParametersRector treated the annotated zero-param count as the maximum and wrongly stripped valid call arguments.

/**
 * @method bool isPublished()
 */
interface TranslationEntityInterface
{
}
-$entity->isPublished(false);
+$entity->isPublished(false); // kept, was wrongly rewritten to isPublished()

Fix: skip AnnotationMethodReflection (magic @method) reflections, same spirit as the existing interface/abstract skips.

@TomasVotruba TomasVotruba merged commit 51d6173 into main Jul 12, 2026
65 checks passed
@TomasVotruba TomasVotruba deleted the skip-magic-method-remove-extra-params branch July 12, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant