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

Squiz/ScopeKeywordSpacing: add additional tests #793

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jan 23, 2025

Description

Squiz/ScopeKeywordSpacing: move parse error test to separate file

Done in a way to maintain the error line numbers for the rest of the file.

Squiz/ScopeKeywordSpacing: move some method tests into a class

... as otherwise the test methods would be unintentional parse errors.

Includes making the method names unique.

Squiz/ScopeKeywordSpacing: add additional tests

This commit adds a few of tests for syntaxes in which the target keywords could be used, which were so far not covered by tests:

  • Tests with the static modifier keyword being used for closures.
  • Tests with visibility keyword applied to class constants.

Squiz/ScopeKeywordSpacing: minor efficiency tweak

Bow out earlier when the sniff won't be able to action anything anyway (live coding/parse errors).

Suggested changelog entry

Squiz.WhiteSpace.ScopeKeywordSpacing: minor efficiency improvement

Related issues/external references

Follow up on #604 (review)

jrfnl added 4 commits January 23, 2025 20:29
Done in a way to maintain the error line numbers for the rest of the file.
... as otherwise the test methods would be _unintentional_ parse errors.

Includes making the method names unique.
This commit adds a few of tests for syntaxes in which the target keywords could be used, which were so far not covered by tests:
* Tests with the `static` modifier keyword being used for closures.
* Tests with visibility keyword applied to class constants.
Bow out earlier when the sniff won't be able to action anything anyway (live coding/parse errors).
@jrfnl jrfnl added this to the 3.12.0 milestone Jan 23, 2025
@jrfnl jrfnl requested a review from fredden January 23, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant