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.PHP.NoFQNTrueFalseNull sniff #327

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Mar 1, 2025

... to forbid using true, false and null as fully qualified constants.

Includes fixer.
Includes unit tests.
Includes documentation.

Note: yes, there is a related tokenizer issue in PHPCS where these tokens are not tokenized the same PHP cross-version, however, the tokenization will change in PHPCS 4.0 as well, so there isn't much point addressing that now as it would just make things even more complicated for sniffs come PHPCS 4.0.

And yes, this does mean that this sniff will need adjusting for PHPCS 4.0.

@jrfnl
Copy link
Member Author

jrfnl commented Mar 1, 2025

@rodrigoprimo Fancy reviewing this PR ?

... to forbid using `true`, `false` and `null` as fully qualified constants.

Includes fixer.
Includes unit tests.
Includes documentation.

Note: yes, there is a related tokenizer issue in PHPCS where these tokens are not tokenized the same PHP cross-version, however, the tokenization will change in PHPCS 4.0 as well, so there isn't much point addressing that now as it would just make things even more complicated for sniffs come PHPCS 4.0.

And yes, this does mean that this sniff will need adjusting for PHPCS 4.0.
@jrfnl jrfnl force-pushed the feature/forbid-fqn-true-false-null branch from 871abc6 to 53fa0b6 Compare March 3, 2025 01:40
@jrfnl
Copy link
Member Author

jrfnl commented Mar 3, 2025

Rebased without changes to allow for new CI check.

Copy link

@rodrigoprimo rodrigoprimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

(sorry for the delay to review this PR)

@jrfnl
Copy link
Member Author

jrfnl commented Mar 20, 2025

Thanks for reviewing @rodrigoprimo !

@jrfnl jrfnl merged commit c3c5741 into develop Mar 20, 2025
47 checks passed
@jrfnl jrfnl deleted the feature/forbid-fqn-true-false-null branch March 20, 2025 17:18
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.

2 participants