Phpinspectionsea: Ensure strict_types location on auto-fix

Created on 11 Sep 2018  路  1Comment  路  Source: kalessil/phpinspectionsea

When using Use ::class instead auto-fix, the generated _use_ statement is appended right after <?php block which works fine. But when declare(strict_types=1); is already defined the _use_ statement is added before the _declare_ statement which makes the file invalid, in my case using Laravel.

As directives are handled as the file is being compiled, only literals may be given as directive values. Variables and constants cannot be used.
https://secure.php.net/manual/en/control-structures.declare.php

screen shot 2018-09-11 at 11 38 17

bug / false-positive fixed

Most helpful comment

Fixed!

>All comments

Fixed!

Was this page helpful?
0 / 5 - 0 ratings