Skip to content

False positive UnusedIssueHandlerSuppression when using UndefinedFunction with referencedFunction #11824

Description

@susnux

The psalm config looks like this:

<!-- ... -->
	<issueHandlers>
		<UndefinedFunction>
			<errorLevel type="suppress">
				<referencedFunction name="p"/>
				<referencedFunction name="emit_css_tag"/>
			</errorLevel>
		</UndefinedFunction>
	</issueHandlers>

With psalm v5 everything worked fine, but when updating to psalm v6.16 psalm reports UnusedIssueHandlerSuppression for UndefinedFunction.
But this is wrong, see the screenshots:

  • By default I get this unusedIssueHandlerSuppression error
  • With the issue handler removed the issues are no longer suppressed and psalm reports them
  • When replacing referencedFunction with directory it works - but this will suppress potentially valid cases:
Default config Removed issue handler With directory instead
Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions