Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create skip_symfony_route_attribute.php.inc #5725

Closed
wants to merge 1 commit into from

Conversation

stephanvierkant
Copy link
Contributor

Fixes #5724.

@TomasVotruba
Copy link
Member

TomasVotruba commented Mar 2, 2021

Thank you 👍

The issue is that docblock does not care about attributes.
The fix would be to place attribute check here:

ClassMethod node has attrGroups property, that contains all the attributes. See: https://github.com/rectorphp/php-parser-nodes-docs/#public-properties-53

Something like this would help:

foreach ($classMethod->attrGroups as $attrGroup)
{
    /** @var AttributeGroup $attrGroup */
    if ($attrGroups->attrs as $phpAttribute) {
       // check if $phpAttribute is route, and skip if so
    }
}

Could you give it a try?

@samsonasik
Copy link
Member

@stephanvierkant I cherry-picked your commit at PR #5737

TomasVotruba added a commit that referenced this pull request Mar 15, 2024
rectorphp/rector-src@a844e40 [Composer] Fix double / on illuminate-container-container-php.patch url on extra:patches config (#5725)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect behavior of PrivatizeLocalOnlyMethodRector: Symfony Route with PHP 8 Attributes
3 participants