Repository: PHP-CS-Fixer/PHP-CS-Fixer (PHP)

Issue:
TypeError: Illegal offset type with multiline_whitespace_before_semicolons
## Bug report

### Description

PHP-CS-Fixer fails to format files with certain token sequences when using the `multiline_whitespace_before_semicolons` with the strategy `no_multi_line`. It throws the error `TypeError: Illegal offset type`.

This doesn't happen with version 3.16.0.

### Runtime version

PHP CS Fixer 3.17.0 Brazilian Kangaroo by Fabien Potencier and Dariusz Ruminski.
PHP runtime: 8.2.6

### Used command

```
php-cs-fixer fix -vvv input.php
```

Output:

```
Files that were not fixed due to errors reported during fixing:
   1) <path>/input.php


        [TypeError]
        Illegal offset type


      PhpCsFixer\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer->findWhitespaceBeforeFirstCall()
        in <path>/vendor/friendsofphp/php-cs-fixer/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php at line 112
      PhpCsFixer\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer->applyFix()
        in <path>/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php at line 75
      PhpCsFixer\AbstractFixer->fix()
        in <path>/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php at line 173
      PhpCsFixer\Runner\Runner->fixFile()
        in <path>/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php at line 114
      PhpCsFixer\Runner\Runner->fix()
        in <path>/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php at line 300
      PhpCsFixer\Console\Command\FixCommand->execute()
        in <path>/vendor/symfony/console/Command/Command.php at line 326
      [ ... ]
```

### Configuration file

```php
<?php

$config = new PhpCsFixer\Config();

return $config->setRules([
    'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
]);
```

### Code snippet that reproduces the problem

```php
<?= $a; ?>
```


Discussion:

Patch:
diff --git a/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php b/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php
index 3bf338e1882..257ec1f0767 100644
--- a/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php
+++ b/src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php
@@ -206,7 +206,7 @@ private function findWhitespaceBeforeFirstCall(int $index, Tokens $tokens): ?str
         $isMultilineCall = false;
         $prevIndex = $tokens->getPrevMeaningfulToken($index);
 
-        while (!$tokens[$prevIndex]->equalsAny([';', '{', '}', [T_OPEN_TAG], [T_ELSE]])) {
+        while (!$tokens[$prevIndex]->equalsAny([';', '{', '}', [T_OPEN_TAG], [T_OPEN_TAG_WITH_ECHO], [T_ELSE]])) {
             $index = $prevIndex;
             $prevIndex = $tokens->getPrevMeaningfulToken($index);
 


Test patch:
diff --git a/tests/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixerTest.php b/tests/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixerTest.php
index dd5f37e0971..1b42cbcf5e1 100644
--- a/tests/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixerTest.php
+++ b/tests/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixerTest.php
@@ -77,6 +77,9 @@ public static function provideMultiLineWhitespaceFixCases(): array
             [
                 "<?php\n;",
             ],
+            [
+                '<?= $a; ?>',
+            ],
             [
                 '<?php
 $this