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

[PEAR.Functions.FunctionCallSignatureSniff] Wording consistency #2825

Closed
VincentLanglet opened this issue Jan 16, 2020 · 2 comments · Fixed by #2921
Closed

[PEAR.Functions.FunctionCallSignatureSniff] Wording consistency #2825

VincentLanglet opened this issue Jan 16, 2020 · 2 comments · Fixed by #2921
Milestone

Comments

@VincentLanglet
Copy link
Contributor

In the FunctionCallSignatureSniff there is the following code

        if ($requiredSpacesAfterOpen === 0 && $tokens[($openBracket + 1)]['code'] === T_WHITESPACE) {
            $error = 'Space after opening parenthesis of function call prohibited';
            ...
        } else if ($requiredSpacesAfterOpen > 0) {
            ...
            if ($spaceAfterOpen !== $requiredSpacesAfterOpen) {
                $error = 'Expected %s spaces after opening bracket; %s found';
                ...
            }
        }//end if
        ...
        if ($spaceBeforeClose !== $requiredSpacesBeforeClose) {
            $error = 'Expected %s spaces before closing bracket; %s found';

Depends on the requiredSpacesAfterOpen value, the message does not have the same format. And we talked sometimes about opening parenthesis, sometimes about opening bracket.

I think using the same wording could be a small improvement. Which one do you prefer ?

@gsherwood
Copy link
Member

I'd be okay changing "bracket" to "parenthesis" but the different error message for when no space is allowed is 100% intentional. I wouldn't change that.

@VincentLanglet
Copy link
Contributor Author

I'd be okay changing "bracket" to "parenthesis".

Yes, I was just talking about this ; I made a PR.

@gsherwood gsherwood added this to the 3.5.5 milestone Mar 30, 2020
gsherwood added a commit that referenced this issue Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants