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

Add metrics to the PSR2.ControlStructures.SwitchDeclaration sniff #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 8, 2023

Description

Recreation of upstream PR squizlabs/PHP_CodeSniffer#1542:

I've explicitly not added metrics for:

  • lowercase keyword as those are already recorded by the Generic.PHP.LowerCaseKeyword sniff
  • break/return not on a line by itself as that is already recorded by the Generic.Formatting.DisallowMultipleStatements sniff

Resolves squizlabs/PHP_CodeSniffer#1541

Please let me know if there is anything you'd like me to change (phrasing and such).

Suggested changelog entry

PSR2/SwitchDeclaration: the sniff can now provide some metric on space usage in switch structures for a code base.

@jrfnl jrfnl force-pushed the feature/3.x-metrics-for-switch-statements branch 3 times, most recently from 0f3ffea to ea5afa9 Compare November 11, 2023 03:28
@jrfnl jrfnl force-pushed the feature/3.x-metrics-for-switch-statements branch 3 times, most recently from e76c34c to 9103d79 Compare December 7, 2023 16:06
@jrfnl jrfnl force-pushed the feature/3.x-metrics-for-switch-statements branch from 9103d79 to 0fdb253 Compare December 26, 2023 01:01
I've explicitly not added metrics for:
* lowercase keyword as those are already recorded by the `Generic.PHP.LowerCaseKeyword` sniff
* `break`/`return` not on a line by itself as that is already recorded by the `Generic.Formatting.DisallowMultipleStatements` sniff
@jrfnl jrfnl force-pushed the feature/3.x-metrics-for-switch-statements branch from 0fdb253 to 782a930 Compare April 23, 2024 21:25
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.

Switch statement metrics
1 participant