@@ -36,7 +36,7 @@ protected function compactContent(string $contents): string
36
36
// Note: $tokens may be updated by reference as well!
37
37
$ retokenized = $ this ->retokenizeAttribute ($ tokens , $ index );
38
38
39
- if (null !== $ retokenized ) {
39
+ if ($ retokenized !== null ) {
40
40
array_splice ($ tokens , $ index , 1 , $ retokenized );
41
41
$ tokenCount = count ($ tokens );
42
42
}
@@ -65,7 +65,7 @@ protected function compactContent(string $contents): string
65
65
// Handle whitespace potentially being split into two tokens after attribute retokenization.
66
66
$ nextToken = $ tokens [$ index + 1 ] ?? null ;
67
67
68
- if (null !== $ nextToken
68
+ if ($ nextToken !== null
69
69
&& $ nextToken ->is (T_WHITESPACE )
70
70
) {
71
71
$ whitespace .= $ nextToken ->text ;
@@ -119,16 +119,16 @@ private static function findAttributeCloser(array $tokens, int $opener): ?int
119
119
$ tokenText = $ tokens [$ i ]->text ;
120
120
121
121
// Allow for short arrays within attributes.
122
- if (' [ ' === $ tokenText ) {
122
+ if ($ tokenText === ' [ ' ) {
123
123
$ brackets [] = $ i ;
124
124
125
125
continue ;
126
126
}
127
127
128
- if (' ] ' === $ tokenText ) {
128
+ if ($ tokenText === ' ] ' ) {
129
129
array_pop ($ brackets );
130
130
131
- if (0 === count ($ brackets )) {
131
+ if (count ($ brackets ) === 0 ) {
132
132
$ closer = $ i ;
133
133
break ;
134
134
}
@@ -157,7 +157,7 @@ private function retokenizeAttribute(array &$tokens, int $opener): ?array
157
157
158
158
// Multi-line attribute or attribute containing something which looks like a PHP close tag.
159
159
// Retokenize the rest of the file after the attribute opener.
160
- if (null === $ closer ) {
160
+ if ($ closer === null ) {
161
161
foreach (array_slice ($ tokens , $ opener + 1 ) as $ token ) {
162
162
$ attributeBody .= $ token ->text ;
163
163
}
@@ -167,7 +167,7 @@ private function retokenizeAttribute(array &$tokens, int $opener): ?array
167
167
168
168
$ closer = self ::findAttributeCloser ($ subTokens , 0 );
169
169
170
- if (null !== $ closer ) {
170
+ if ($ closer !== null ) {
171
171
array_splice (
172
172
$ tokens ,
173
173
$ opener + 1 ,
@@ -179,7 +179,7 @@ private function retokenizeAttribute(array &$tokens, int $opener): ?array
179
179
}
180
180
}
181
181
182
- if (null === $ closer ) {
182
+ if ($ closer === null ) {
183
183
return null ;
184
184
}
185
185
0 commit comments