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

Update phpcs.xml to allow non-namespaced classes in select areas #16470

Merged
merged 1 commit into from Sep 19, 2023

Conversation

smg6511
Copy link
Collaborator

@smg6511 smg6511 commented Sep 8, 2023

What does it do?

Adds targeted rule to exclude the PSR1 MissingNamespace error.

Why is it needed?

Two areas of the core—the TV renders and manager controllers—do not declare a namespace in their classes and cause an unfixable code quality error in those files. This is particularly problematic when submitting PRs with changes to those files. Under the assumption that there was good reason to not namespace those files, I opted to adjust the ruleset.

How to test

Simply compare a handful of classes in the noted areas (look at the added rules to see the base paths to those areas) to others in the main core (not components, etc.). Note how the currently non-namespaced classes will not show an error for the rule in question, while ones that do have a namespace will show an error if you delete the namespace declaration.

Related issue(s)/PR(s)

None. Actually was motivated to make the change because my most recent PR (#16469) is failing checks because of the rule issue.

Allow missing namespace in select areas
@opengeek opengeek merged commit c948618 into modxcms:3.x Sep 19, 2023
7 checks passed
@smg6511 smg6511 added this to the v3.0.4 milestone Sep 23, 2023
@smg6511 smg6511 deleted the 3.x-adjust-phpcs-rule--missing-ns branch November 1, 2023 04:59
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 this pull request may close these issues.

None yet

3 participants