Skip to content

Invalid linter:no-redundant-method-override in special case #2170

Description

@Plastonick

Description

In some cases, we might have to override the parent method to narrow the type signature. Not doing so would be a PHP fatal error. That parent may be a vendored class so isn't itself alterable. Mago linter however emits a no-redundant-method-override and doesn't recognise that it's not redundant.

Playground Link

https://mago.carthage.software/1.45.0/en/playground/#019fcd5e-5d98-e41b-aba3-01149d1ed443

Reproduction

No response

Environment

Replicated on the playground.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c-linterPHP linting for errors, style, and bugst-bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions