Skip to content

Report deprecations as warnings instead of errors #11

@nesk

Description

@nesk

I think using a deprecated class/method/property/whatever (let's name those as entity) shouldn't be reported as an error but as a warning. The key differences I see here are:

  • The code using a deprecated entity will run, it just might break one day, but PHPStan will then trigger an error about the entity being unknown.
  • Reporting a warning instead of an error should not make the CLI exit with a status code different than 0, but it should still output the deprecation message.

Sometimes I deprecate some classes/methods in my code until I'm sure I don't use them anymore, however PHPStan will then complain about them, so I must ignore the errors, which defeats the purpose of using those deprecation rules.

What do you think about this?

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