Skip to content

When a call is disallowed due to a parameter rule, display a different message #155

@spaze

Description

@spaze

Discussed in #154

Originally posted by eithed December 19, 2022
I'd like to disallow different methods, with different messages, dependent upon the number of parameters used. For example, if I've got function:

function foo($bar = '', $xyz = ''){}

I'd like to display:

  • if foo() is used anywhere, display Don't use foo
  • if foo(*) is used anywhere, display Don't use foo with parameter $bar
  • if foo(*,*) is used anywhere, display Don't use foo with parameters $bar and $xyz

Is this possible at all?

Maintainer note: I think a param-level message could be added that would override the main message when a call would be disallowed due to disallowed/missing param.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions