We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2afec65 commit 8752839Copy full SHA for 8752839
src/Parser/StringUnescaper.php
@@ -2,6 +2,7 @@
2
3
namespace PHPStan\PhpDocParser\Parser;
4
5
+use PHPStan\ShouldNotHappenException;
6
use function chr;
7
use function hexdec;
8
use function octdec;
@@ -56,6 +57,9 @@ static function ($matches) {
56
57
return chr((int) hexdec(substr($str, 1)));
58
}
59
if ($str[0] === 'u') {
60
+ if (!isset($matches[2])) {
61
+ throw new ShouldNotHappenException();
62
+ }
63
return self::codePointToUtf8((int) hexdec($matches[2]));
64
65
0 commit comments