Skip to content

Commit a6efc9b

Browse files
committed
Fix coding standard issues after #428
Signed-off-by: William Desportes <[email protected]>
1 parent e2c0e89 commit a6efc9b

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

src/Token.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,17 @@ class Token
113113
* All tokens types
114114
*/
115115
public const TYPE_ALL = [
116-
Token::TYPE_NONE,
117-
Token::TYPE_KEYWORD,
118-
Token::TYPE_OPERATOR,
119-
Token::TYPE_WHITESPACE,
120-
Token::TYPE_COMMENT,
121-
Token::TYPE_BOOL,
122-
Token::TYPE_NUMBER,
123-
Token::TYPE_STRING,
124-
Token::TYPE_SYMBOL,
125-
Token::TYPE_DELIMITER,
126-
Token::TYPE_LABEL,
116+
self::TYPE_NONE,
117+
self::TYPE_KEYWORD,
118+
self::TYPE_OPERATOR,
119+
self::TYPE_WHITESPACE,
120+
self::TYPE_COMMENT,
121+
self::TYPE_BOOL,
122+
self::TYPE_NUMBER,
123+
self::TYPE_STRING,
124+
self::TYPE_SYMBOL,
125+
self::TYPE_DELIMITER,
126+
self::TYPE_LABEL,
127127
];
128128

129129
// Flags that describe the tokens in more detail.

src/TokensList.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use ArrayAccess;
88

99
use function count;
10+
use function in_array;
1011
use function is_array;
1112
use function is_string;
1213

@@ -140,9 +141,10 @@ public function getPrevious(): ?Token
140141
*/
141142
public function getPreviousOfType($type)
142143
{
143-
if (!is_array($type)) {
144+
if (! is_array($type)) {
144145
$type = [$type];
145146
}
147+
146148
for (; $this->idx >= 0; --$this->idx) {
147149
if (in_array($this->tokens[$this->idx]->type, $type, true)) {
148150
return $this->tokens[$this->idx--];
@@ -161,9 +163,10 @@ public function getPreviousOfType($type)
161163
*/
162164
public function getNextOfType($type)
163165
{
164-
if (!is_array($type)) {
166+
if (! is_array($type)) {
165167
$type = [$type];
166168
}
169+
167170
for (; $this->idx < $this->count; ++$this->idx) {
168171
if (in_array($this->tokens[$this->idx]->type, $type, true)) {
169172
return $this->tokens[$this->idx++];

0 commit comments

Comments
 (0)