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

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

Closed
spaze opened this issue Dec 19, 2022 Discussed in #154 · 0 comments · Fixed by #232
Closed

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

spaze opened this issue Dec 19, 2022 Discussed in #154 · 0 comments · Fixed by #232
Labels
enhancement New feature or request

Comments

@spaze
Copy link
Owner

spaze commented Dec 19, 2022

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.

@spaze spaze added the enhancement New feature or request label Dec 19, 2022
spaze added a commit that referenced this issue Mar 20, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Mar 20, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Apr 24, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Jun 15, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Jun 15, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Jul 1, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Jul 2, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Jul 7, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Jul 23, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Jul 26, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Sep 20, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Oct 28, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Nov 30, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Dec 10, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Dec 10, 2023
This adds a new error on the same line where previous error is reported but the newly added error is due to a different parameter, check the error message, it's different.

For #155
spaze added a commit that referenced this issue Dec 12, 2023
More rules sorted from the most specific to the least specific may work but right now it doesn't

For #155
spaze added a commit that referenced this issue Dec 13, 2023
…arious params.

The rules have to be sorted from the most specific to the most general to have different messages for different params, see FunctionCallsParamsMessagesTest.

For #155
spaze added a commit that referenced this issue Dec 13, 2023
…arious params.

The rules have to be sorted from the most specific to the most general to have different messages for different params, see FunctionCallsParamsMessagesTest.

For #155
spaze added a commit that referenced this issue Dec 13, 2023
…arious params.

The rules have to be sorted from the most specific to the most general to have different messages for different params, see FunctionCallsParamsMessagesTest.

Close #155
spaze added a commit that referenced this issue Dec 13, 2023
…arious params.

The rules have to be sorted from the most specific to the most general to have different messages for different params, see FunctionCallsParamsMessagesTest.

Close #155
spaze added a commit that referenced this issue Dec 13, 2023
…arious params.

The rules have to be sorted from the most specific to the most general to have different messages for different params, see FunctionCallsParamsMessagesTest.

Close #155
spaze added a commit that referenced this issue Dec 15, 2023
…arious params (#232)

The rules have to be sorted from the most specific to the most general to have different messages for different params, see `FunctionCallsParamsMessagesTest`.

This makes sense mostly|only when you want to show a different message when various params have been disallowed. For which the new config options `allowExceptParamsAnyValue` and `disallowParamsAnyValue` (which is an alias for the former) have been added.

Close #155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant