@@ -36,7 +36,7 @@ protected function compactContent(string $contents): string
3636 // Note: $tokens may be updated by reference as well!
3737 $ retokenized = $ this ->retokenizeAttribute ($ tokens , $ index );
3838
39- if (null !== $ retokenized ) {
39+ if ($ retokenized !== null ) {
4040 array_splice ($ tokens , $ index , 1 , $ retokenized );
4141 $ tokenCount = count ($ tokens );
4242 }
@@ -65,7 +65,7 @@ protected function compactContent(string $contents): string
6565 // Handle whitespace potentially being split into two tokens after attribute retokenization.
6666 $ nextToken = $ tokens [$ index + 1 ] ?? null ;
6767
68- if (null !== $ nextToken
68+ if ($ nextToken !== null
6969 && $ nextToken ->is (T_WHITESPACE )
7070 ) {
7171 $ whitespace .= $ nextToken ->text ;
@@ -119,16 +119,16 @@ private static function findAttributeCloser(array $tokens, int $opener): ?int
119119 $ tokenText = $ tokens [$ i ]->text ;
120120
121121 // Allow for short arrays within attributes.
122- if (' [ ' === $ tokenText ) {
122+ if ($ tokenText === ' [ ' ) {
123123 $ brackets [] = $ i ;
124124
125125 continue ;
126126 }
127127
128- if (' ] ' === $ tokenText ) {
128+ if ($ tokenText === ' ] ' ) {
129129 array_pop ($ brackets );
130130
131- if (0 === count ($ brackets )) {
131+ if (count ($ brackets ) === 0 ) {
132132 $ closer = $ i ;
133133 break ;
134134 }
@@ -157,7 +157,7 @@ private function retokenizeAttribute(array &$tokens, int $opener): ?array
157157
158158 // Multi-line attribute or attribute containing something which looks like a PHP close tag.
159159 // Retokenize the rest of the file after the attribute opener.
160- if (null === $ closer ) {
160+ if ($ closer === null ) {
161161 foreach (array_slice ($ tokens , $ opener + 1 ) as $ token ) {
162162 $ attributeBody .= $ token ->text ;
163163 }
@@ -167,7 +167,7 @@ private function retokenizeAttribute(array &$tokens, int $opener): ?array
167167
168168 $ closer = self ::findAttributeCloser ($ subTokens , 0 );
169169
170- if (null !== $ closer ) {
170+ if ($ closer !== null ) {
171171 array_splice (
172172 $ tokens ,
173173 $ opener + 1 ,
@@ -179,7 +179,7 @@ private function retokenizeAttribute(array &$tokens, int $opener): ?array
179179 }
180180 }
181181
182- if (null === $ closer ) {
182+ if ($ closer === null ) {
183183 return null ;
184184 }
185185
0 commit comments