@@ -113,7 +113,7 @@ private function collectLongLinesData(File $file, int $start): array
113113 for ($ i = $ start ; $ i < $ file ->numTokens ; $ i ++) {
114114 // Still processing previous line: increment length and continue.
115115 if ($ lastLine && ($ tokens [$ i ]['line ' ] === $ lastLine )) {
116- $ content = (string )$ tokens [$ i ]['content ' ];
116+ $ content = (string ) $ tokens [$ i ]['content ' ];
117117 $ data [$ lastLine ]['length ' ] += strlen ($ content );
118118 $ data [$ lastLine ]['nonEmptyLength ' ] += strlen (trim ($ content ));
119119 continue ;
@@ -124,8 +124,8 @@ private function collectLongLinesData(File $file, int $start): array
124124 $ data [$ lastLine ]['end ' ] = $ i - 1 ;
125125 }
126126
127- $ lastLine = (int )$ tokens [$ i ]['line ' ];
128- $ content = (string )$ tokens [$ i ]['content ' ];
127+ $ lastLine = (int ) $ tokens [$ i ]['line ' ];
128+ $ content = (string ) $ tokens [$ i ]['content ' ];
129129 $ data [$ lastLine ] = [
130130 'length ' => strlen ($ content ),
131131 'nonEmptyLength ' => strlen (trim ($ content )),
@@ -228,7 +228,7 @@ private function isLongHtmlAttribute(
228228 $ inPhp = true ;
229229 }
230230 if ($ tokens [$ i ]['code ' ] === T_INLINE_HTML || $ inPhp ) {
231- $ tokenContent = (string )$ tokens [$ i ]['content ' ];
231+ $ tokenContent = (string ) $ tokens [$ i ]['content ' ];
232232 $ content .= $ inPhp ? str_repeat ('x ' , strlen ($ tokenContent )) : $ tokenContent ;
233233 }
234234 if ($ tokens [$ i ]['code ' ] === T_CLOSE_TAG && $ inPhp ) {
@@ -271,7 +271,12 @@ private function isLongSingleWord(
271271 array $ tokens
272272 ): bool {
273273
274- $ words = preg_split ('~\s+~ ' , (string )$ tokens [$ position ]['content ' ], 2 , PREG_SPLIT_NO_EMPTY );
274+ $ words = preg_split (
275+ '~\s+~ ' ,
276+ (string ) $ tokens [$ position ]['content ' ],
277+ 2 ,
278+ PREG_SPLIT_NO_EMPTY
279+ );
275280
276281 // If multiple words exceed line limit, we can split each word in its own line
277282 if ($ words === false || count ($ words ) !== 1 ) {
@@ -281,7 +286,7 @@ private function isLongSingleWord(
281286 $ word = reset ($ words );
282287 $ firstNonWhitePos = $ file ->findNext (T_WHITESPACE , $ position , $ lineEnd , true );
283288 $ firstNonWhite = ($ firstNonWhitePos === false ) ? null : $ tokens [$ firstNonWhitePos ];
284- $ tolerance = is_array ($ firstNonWhite ) ? ((int )($ firstNonWhite ['column ' ] ?? 1 ) + 3 ) : 4 ;
289+ $ tolerance = is_array ($ firstNonWhite ) ? ((int ) ($ firstNonWhite ['column ' ] ?? 1 ) + 3 ) : 4 ;
285290
286291 return (strlen ($ word ) + $ tolerance ) > $ this ->lineLimit ;
287292 }
@@ -320,7 +325,7 @@ private function isLongI10nFunction(File $file, array $tokens, int $start, int $
320325 return false ;
321326 }
322327
323- $ function = strtolower ((string )$ tokens [$ functionPos ]['content ' ]);
328+ $ function = strtolower ((string ) $ tokens [$ functionPos ]['content ' ]);
324329 if (!in_array ($ function , self ::I18N_FUNCTIONS , true )) {
325330 return false ;
326331 }
@@ -333,7 +338,7 @@ private function isLongI10nFunction(File $file, array $tokens, int $start, int $
333338 if ($ tokens [$ i ]['line ' ] !== $ targetLine ) {
334339 continue ;
335340 }
336- $ textLen += max (1 , strlen ((string )$ tokens [$ i ]['content ' ]));
341+ $ textLen += max (1 , strlen ((string ) $ tokens [$ i ]['content ' ]));
337342 }
338343
339344 return ($ textLen + 2 ) > $ this ->lineLimit ;
@@ -360,7 +365,7 @@ private function isLongUse(File $file, array $tokens, int $start, int $end): boo
360365 $ endUse = $ file ->findEndOfStatement ($ usePos );
361366 $ useLen = 0 ;
362367 for ($ i = $ usePos ; $ i <= $ endUse ; $ i ++) {
363- $ useLen += strlen ((string )$ tokens [$ i ]['content ' ]);
368+ $ useLen += strlen ((string ) $ tokens [$ i ]['content ' ]);
364369 }
365370
366371 return $ useLen > $ this ->lineLimit ;
0 commit comments