PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.17
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.17
1.10.25 1.10.24 1.10.23 1.10.22 1.10.21 1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 All 169 releases
← All changes | vendor/symfony/polyfill-php80/PhpToken.php +4 -6 1.10.21 → 1.10.17 View file →
@@ -50,13 +50,13 @@
50 50 }
51 51
52 52 public function getTokenName(): ?string
53 53 {
54 - if ($this->id < 256) {
55 - return \chr($this->id & 0xFF);
54 + if ('UNKNOWN' === $name = token_name($this->id)) {
55 + $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text;
56 56 }
57 57
58 - return 'UNKNOWN' === ($name = token_name($this->id)) ? null : $name;
58 + return $name;
59 59 }
60 60
61 61 /**
62 62 * @param int|string|array $kind
@@ -91,10 +91,9 @@
91 91 $position = 0;
92 92 $tokens = token_get_all($code, $flags);
93 93 foreach ($tokens as $index => $token) {
94 94 if (\is_string($token)) {
95 - // b" is the only such token longer than one char
96 - $id = \ord($token[-1]);
95 + $id = \ord($token);
97 96 $text = $token;
98 97 } else {
99 98 [$id, $text, $line] = $token;
100 99 }
@@ -99,9 +98,8 @@
99 98 [$id, $text, $line] = $token;
100 99 }
101 100 $tokens[$index] = new static($id, $text, $line, $position);
102 101 $position += \strlen($text);
103 - $line += preg_match_all('/\r\n?|\n/', $text);
104 102 }
105 103
106 104 return $tokens;
107 105 }