Skip to content

Commit bb245d1

Browse files
committed
Variables::isSuperglobal(): implement use of TextStrings::stripQuotes()
1 parent e72a83a commit bb245d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

PHPCSUtils/Utils/Variables.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use PHP_CodeSniffer\Util\Tokens;
1616
use PHPCSUtils\Tokens\Collections;
1717
use PHPCSUtils\Utils\Scopes;
18+
use PHPCSUtils\Utils\TextStrings;
1819

1920
/**
2021
* Utility functions for use when examining variables.
@@ -277,7 +278,7 @@ public static function isSuperglobal(File $phpcsFile, $stackPtr)
277278
}
278279

279280
// Strip quotes.
280-
$content = \preg_replace('`^([\'"])(.*)\1$`Ds', '$2', $content);
281+
$content = TextStrings::stripQuotes($content);
281282
}
282283

283284
return self::isSuperglobalName($content);

0 commit comments

Comments
 (0)