SensitiveConstantNameRector: ignore existing contants

case-sensitivity test of `defined()`: https://3v4l.org/DA23r
This commit is contained in:
Jan Kuchař 2019-02-21 01:03:08 +01:00 committed by GitHub
parent aecebd1d5c
commit fc91cc3ec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,6 +118,10 @@ CODE_SAMPLE
}
$currentConstantName = (string) $node->name;
if (\defined($currentConstantName)) {
return null;
}
// is uppercase, all good
if ($currentConstantName === strtoupper($currentConstantName)) {