[
https://issues.apache.org/jira/browse/NETBEANS-4978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17454122#comment-17454122
]
Jayce commented on NETBEANS-4978:
---------------------------------
Tested with official 12.6. Still wrong.
It ignores "declare(strict_types=1);" line position.
As a result if you have a "use" line, followed by declare(strict_types=1); (let
say it's bad because of previous version of Netbeans), "Fix uses" will insert
the new use line after the existing use line, ignoring declare(strict_types=1);.
declare(strict_types=1); *MUST* *always* *be the FIRST line.*
Just reorder them properly:
1) declare(strict_types=1);
2) namespace XXX
3) use yyy
> PHP Menu Source->Fix uses break code
> ------------------------------------
>
> Key: NETBEANS-4978
> URL: https://issues.apache.org/jira/browse/NETBEANS-4978
> Project: NetBeans
> Issue Type: Improvement
> Components: php - Editor
> Affects Versions: 12.0
> Reporter: Jayce
> Assignee: Junichi Yamamoto
> Priority: Minor
> Labels: pull-request-available
> Fix For: 12.6
>
> Attachments: 01BeforeFixUses.png, 02AfterFixUses.png, BugClass.php,
> BugScreencast.mov
>
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> Using "Fix Uses" (Source menu) break code by moving "use \Package\To\Use;"
> before "declare(strict_types=1);"
> It does not happen if a use line is already present in the source code (at
> the correct position).
> declare(strict_types=1); must always be the first line.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists