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

"This element is not expected" when using referencedClass or referencedMethod #2297

Closed
ruudk opened this issue Nov 4, 2019 · 2 comments
Closed

Comments

@ruudk
Copy link
Contributor

ruudk commented Nov 4, 2019

After reading the docs https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#config-suppression I tried to add this:

// ...
<issueHandlers>
        <RedundantConditionGivenDocblockType errorLevel="info">
            <errorLevel type="suppress">
                <referencedClass name="Stripe\Card" />
            </errorLevel>
        </RedundantConditionGivenDocblockType>

But I get this error:

Problem parsing /Volumes/CS/www/psalm.xml:
  Error on line 51:
    Element '{https://getpsalm.org/schema/config}referencedClass': This element is not expected.

exit status 1
@weirdan
Copy link
Collaborator

weirdan commented Nov 4, 2019

Not every issue type supports referencedClass (only those extending ClassIssue do). RedundantConditionGivenDocblockType is not one of those.

@muglug
Copy link
Collaborator

muglug commented Nov 4, 2019

Yeah, you want to be suppressing those particular ones line by line. Alternatively you could stub out the proper return types, if the stripe-given ones are incorrect.

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

No branches or pull requests

3 participants