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 sniff to disallow import use statements for functions/constants in the global namespace #214

Closed
jrfnl opened this issue Jun 17, 2020 · 1 comment
Milestone

Comments

@jrfnl
Copy link
Collaborator

jrfnl commented Jun 17, 2020

Discussed on Slack with @herregroen

Disallow import use statements for functions and constants from the global namespace:

use func esc_attr;

use const PHP_VERSION_ID;

in favour of enforcing fully qualified names in the inline code:

\esc_attr( $something );

\version_compare( \PHP_VERSION_ID, '70300' );
@jrfnl jrfnl added this to the 3.0 milestone Oct 7, 2020
@jrfnl jrfnl mentioned this issue May 26, 2023
52 tasks
@jrfnl
Copy link
Collaborator Author

jrfnl commented Dec 14, 2023

I'm going to close this issue as "fixed".

Importing functions/constants is now disallowed. The use of fully qualified global functions and constants is now enforced, so this should be considered covered.

@jrfnl jrfnl closed this as completed Dec 14, 2023
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

No branches or pull requests

1 participant