-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
Bug Description
ConstantStringSniff doesn't allow for namespaces before the string.
Minimal Code Snippet
namespace Foo\Bar;
const REST_ALLOWED_META_PREFIXES = [ 'foo-', 'bar-', 'baz-' ];
if ( defined( __NAMESPACE__ . '\REST_ALLOWED_META_PREFIXES' ) && in_array( 'foo-', REST_ALLOWED_META_PREFIXES, true ) ) {
}Error Code
Constant name, as a string, should be used along with
defined().
(WordPressVIPMinimum.Constants.ConstantString.NotCheckingConstantName)
Environment
| Question | Answer |
|---|---|
| PHP version | 7.3.2 |
| PHP_CodeSniffer version | 3.4.2 |
| VIPCS version | 1.0.0 |
Tested Against master branch?
- I have verified the issue still exists in the
masterbranch of VIPCS.
Reactions are currently unavailable