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?
Bug Description
ConstantStringSniff doesn't allow for namespaces before the string.
Minimal Code Snippet
Error Code
Environment
Tested Against
masterbranch?masterbranch of VIPCS.