@@ -238,8 +238,9 @@ public function process(File $phpcsFile, $stackPtr)
238
238
if (isset ($ tokens [$ parenCloser ]['nested_parenthesis ' ]) === true
239
239
&& empty ($ tokens [$ parenCloser ]['nested_parenthesis ' ]) === false
240
240
) {
241
- end ($ tokens [$ parenCloser ]['nested_parenthesis ' ]);
242
- $ parens = key ($ tokens [$ parenCloser ]['nested_parenthesis ' ]);
241
+ $ parens = $ tokens [$ parenCloser ]['nested_parenthesis ' ];
242
+ end ($ parens );
243
+ $ parens = key ($ parens );
243
244
if ($ this ->debug === true ) {
244
245
$ line = $ tokens [$ parens ]['line ' ];
245
246
echo "\t* token has nested parenthesis $ parens on line $ line * " .PHP_EOL ;
@@ -250,8 +251,9 @@ public function process(File $phpcsFile, $stackPtr)
250
251
if (isset ($ tokens [$ parenCloser ]['conditions ' ]) === true
251
252
&& empty ($ tokens [$ parenCloser ]['conditions ' ]) === false
252
253
) {
253
- end ($ tokens [$ parenCloser ]['conditions ' ]);
254
- $ condition = key ($ tokens [$ parenCloser ]['conditions ' ]);
254
+ $ condition = $ tokens [$ parenCloser ]['conditions ' ];
255
+ end ($ condition );
256
+ $ condition = key ($ condition );
255
257
if ($ this ->debug === true ) {
256
258
$ line = $ tokens [$ condition ]['line ' ];
257
259
$ type = $ tokens [$ condition ]['type ' ];
@@ -511,8 +513,9 @@ public function process(File $phpcsFile, $stackPtr)
511
513
&& $ tokens [$ checkToken ]['scope_opener ' ] === $ checkToken ))
512
514
) {
513
515
if (empty ($ tokens [$ checkToken ]['conditions ' ]) === false ) {
514
- end ($ tokens [$ checkToken ]['conditions ' ]);
515
- $ condition = key ($ tokens [$ checkToken ]['conditions ' ]);
516
+ $ condition = $ tokens [$ checkToken ]['conditions ' ];
517
+ end ($ condition );
518
+ $ condition = key ($ condition );
516
519
} else {
517
520
$ condition = $ tokens [$ checkToken ]['scope_condition ' ];
518
521
}
@@ -653,8 +656,9 @@ public function process(File $phpcsFile, $stackPtr)
653
656
if (isset ($ tokens [$ scopeCloser ]['nested_parenthesis ' ]) === true
654
657
&& empty ($ tokens [$ scopeCloser ]['nested_parenthesis ' ]) === false
655
658
) {
656
- end ($ tokens [$ scopeCloser ]['nested_parenthesis ' ]);
657
- $ parens = key ($ tokens [$ scopeCloser ]['nested_parenthesis ' ]);
659
+ $ parens = $ tokens [$ scopeCloser ]['nested_parenthesis ' ];
660
+ end ($ parens );
661
+ $ parens = key ($ parens );
658
662
if ($ this ->debug === true ) {
659
663
$ line = $ tokens [$ parens ]['line ' ];
660
664
echo "\t* token has nested parenthesis $ parens on line $ line * " .PHP_EOL ;
@@ -665,8 +669,9 @@ public function process(File $phpcsFile, $stackPtr)
665
669
if (isset ($ tokens [$ scopeCloser ]['conditions ' ]) === true
666
670
&& empty ($ tokens [$ scopeCloser ]['conditions ' ]) === false
667
671
) {
668
- end ($ tokens [$ scopeCloser ]['conditions ' ]);
669
- $ condition = key ($ tokens [$ scopeCloser ]['conditions ' ]);
672
+ $ condition = $ tokens [$ scopeCloser ]['conditions ' ];
673
+ end ($ condition );
674
+ $ condition = key ($ condition );
670
675
if ($ this ->debug === true ) {
671
676
$ line = $ tokens [$ condition ]['line ' ];
672
677
$ type = $ tokens [$ condition ]['type ' ];
@@ -1181,8 +1186,9 @@ public function process(File $phpcsFile, $stackPtr)
1181
1186
if (isset ($ tokens [$ i ]['nested_parenthesis ' ]) === true
1182
1187
&& empty ($ tokens [$ i ]['nested_parenthesis ' ]) === false
1183
1188
) {
1184
- end ($ tokens [$ i ]['nested_parenthesis ' ]);
1185
- $ parens = key ($ tokens [$ i ]['nested_parenthesis ' ]);
1189
+ $ parens = $ tokens [$ i ]['nested_parenthesis ' ];
1190
+ end ($ parens );
1191
+ $ parens = key ($ parens );
1186
1192
if ($ this ->debug === true ) {
1187
1193
$ line = $ tokens [$ parens ]['line ' ];
1188
1194
echo "\t* token has nested parenthesis $ parens on line $ line * " .PHP_EOL ;
@@ -1193,8 +1199,9 @@ public function process(File $phpcsFile, $stackPtr)
1193
1199
if (isset ($ tokens [$ i ]['conditions ' ]) === true
1194
1200
&& empty ($ tokens [$ i ]['conditions ' ]) === false
1195
1201
) {
1196
- end ($ tokens [$ i ]['conditions ' ]);
1197
- $ condition = key ($ tokens [$ i ]['conditions ' ]);
1202
+ $ condition = $ tokens [$ i ]['conditions ' ];
1203
+ end ($ condition );
1204
+ $ condition = key ($ condition );
1198
1205
if ($ this ->debug === true ) {
1199
1206
$ line = $ tokens [$ condition ]['line ' ];
1200
1207
$ type = $ tokens [$ condition ]['type ' ];
0 commit comments