Jayce created NETBEANS-6264:
-------------------------------

             Summary: PHP Menu Source->Fix uses ignored strict_types line
                 Key: NETBEANS-6264
                 URL: https://issues.apache.org/jira/browse/NETBEANS-6264
             Project: NetBeans
          Issue Type: Bug
          Components: php - Editor
    Affects Versions: 12.5, 12.6
            Reporter: Jayce
            Assignee: Junichi Yamamoto


As asked here: https://issues.apache.org/jira/browse/NETBEANS-4978

Scenario:

Netbeans 12.5 (old) created a *bad* php file with the Fix Use command, let says 
this one:
{code:java}
<?php
namespace \bar;
use \foo;
declare(strict_types=1); 

class ....{code}
If in this file i have an other full namespace used somewhere that need to be 
inserted in the use lines, i use the Fix Use command.

The problem is, in Netbeans 12.6, the Fix use command does not move the 
strict_types line. It will insert near the existing use line, like this one:
{code:java}
<?php 
namespace \bar; 
use \foo; 
use \newly\Inserted; 
declare(strict_types=1);  {code}
 

Just parse the file (before class for example) and move the 
"declare(strict_types=1); " line at the top, whatever the file contains.

declare(strict_types=1); *MUST* *always* *be the FIRST line.*

Just reorder them properly:

0)<?php
1) declare(strict_types=1);
2) namespace XXX
3) use yyy

Thanks



--
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

Reply via email to