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

✨ New Universal.UseStatements.KeywordSpacing sniff #247

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jun 19, 2023

New sniff to enforce the use of a single space after the use, function, const keywords and both before and after the as keyword in import use statements.

This sniff is complementary to the PHPCS native Generic.WhiteSpace.LanguageConstructSpacing sniff which only checks the spacing after the use keyword in an import `use statement.

The sniff has modular error codes to allow for disabling individual checks. The error codes are: SpaceAfterUse, SpaceAfterFunction, SpaceAfterConst, SpaceBeforeAs and SpaceAfterAs.

Includes fixer.
Includes unit tests.
Includes documentation.
Includes metrics.

New sniff to enforce the use of a single space after the `use`, `function`, `const` keywords and both before and after the `as` keyword in import `use` statements.

This sniff is complementary to the PHPCS native `Generic.WhiteSpace.LanguageConstructSpacing` sniff which only checks the spacing after the `use` keyword in an import `use statement.

The sniff has modular error codes to allow for disabling individual checks. The error codes are: `SpaceAfterUse`, `SpaceAfterFunction`, `SpaceAfterConst`, `SpaceBeforeAs` and `SpaceAfterAs`.

Includes fixer.
Includes unit tests.
Includes documentation.
Includes metrics.
@jrfnl jrfnl force-pushed the feature/new-usestatements-keywordspacing-sniff branch from 94208a3 to 4fbf9d4 Compare June 19, 2023 03:03
@jrfnl jrfnl merged commit adf5c0f into develop Jun 19, 2023
@jrfnl jrfnl deleted the feature/new-usestatements-keywordspacing-sniff branch June 19, 2023 03:09
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