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

TooManyArguments does not support methods in issueHandlers #10070

Closed
GTony opened this issue Aug 1, 2023 · 5 comments · Fixed by #10071
Closed

TooManyArguments does not support methods in issueHandlers #10070

GTony opened this issue Aug 1, 2023 · 5 comments · Fixed by #10071
Assignees
Labels

Comments

@GTony
Copy link

GTony commented Aug 1, 2023

Since 5.14 following the changes in #9981 it's not longer possible to pass a method to referencedFunction

As of version 5.13.1 our psalm.xml looked as follow.

<issueHandlers>
    <TooManyArguments>
        <errorLevel type="suppress">
            <referencedFunction name="Doctrine\DBAL\Query\QueryBuilder::select"/>
            ...
        </errorLevel>
    </TooManyArguments>
</issueHandlers>

But now running psalm will return this error as per the recent changes.

Invalid referencedFunction doctrine\dbal\query\querybuilder::select

As it now stands it's impossible to suppress TooManyArguments for anything other than basic function.

Should TooManyArguments support referencedMethod or should the regex on referencedFunction also support methods?

It's also possible I'm entirely in the wrong and I shouldn't suppress TooManyArguments error for methods.

To be noted, I am aware of the existence of a plugin to help psalm with some of Doctrine's issues, but this is not the problem right here.

@psalm-github-bot
Copy link

Hey @GTony, can you reproduce the issue on https://psalm.dev ?

@weirdan
Copy link
Collaborator

weirdan commented Aug 1, 2023

Should TooManyArguments support referencedMethod

It should.

@weirdan
Copy link
Collaborator

weirdan commented Aug 1, 2023

It should.

From a user standpoint, that is. Not exactly easy to implement, given how we filter issues.

Anyway, this seems like an unintentional BC break, and I'll be looking to fix it.

/cc: @orklah @kkmuffme

@weirdan weirdan added the bug label Aug 1, 2023
@weirdan weirdan self-assigned this Aug 1, 2023
@weirdan
Copy link
Collaborator

weirdan commented Aug 1, 2023

@GTony meanwhile, you can work this around by converting the filter into a PCRE regular expression:

            <referencedFunction name="@Doctrine\\DBAL\\Query\\QueryBuilder::select@"/>

@weirdan
Copy link
Collaborator

weirdan commented Aug 1, 2023

The fix is available in 5.14.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants