You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with such diff/code, MultilineWhitespaceBeforeSemicolonsFixer fixer crashes:
[RuntimeException]
Index invalid or out of range
PhpCsFixer\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer->findWhitespaceBeforeFirstCall()
in ...src\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer.php at line 112
PhpCsFixer\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer->applyFix()
in ...src\AbstractFixer.php at line 75
PhpCsFixer\AbstractFixer->fix()
in ...src\Runner\Runner.php at line 173
PhpCsFixer\Runner\Runner->fixFile()
in ...src\Runner\Runner.php at line 114
PhpCsFixer\Runner\Runner->fix()
in ...src\Console\Command\FixCommand.php at line 303
PhpCsFixer\Console\Command\FixCommand->execute()
in ...vendor\symfony\console\Command\Command.php at line 298
This must be improved here, I did not take no-namespace files into consideration 😕. Probably imports should be inserted before the first statement other than declare.
Bug report
It seems
fully_qualified_strict_types
adds theuse
s abovedeclare(strict_types=1)
leading to header comment duplication byheader_comment
.Maybe only a priority issue as
declare_strict_types
should asserts thedeclare(strict_types=1)
is always the first statement after<?php
.fully_qualified_strict_types
should be however fixed too to add theuse
s after the strict declare statement.Quick help welcomed as the last PHP CS Fixer updated started to add a lot of
use
imports but the duplicated header is never removed by any fixer!The text was updated successfully, but these errors were encountered: