Eugene-Melbourne commented on issue #6082:
URL: https://github.com/apache/netbeans/issues/6082#issuecomment-1607178365

   Thank you for your explanation.
   You are right there is more to it.
   
   The file must have no `namespace`, but the classes should have some 
`namespace` other than default.
   I did not know this aspect before. Now I understand why it was difficult to 
reproduce.
   
   so you would need 2 files
   
   1) `MyClass.php`
   ```
       <?php
       namespace App\Helpers;
       class MyClass
       {}
   ```
   2) tmp.php
   ```
   <?php
   /**
    * 1
    */
   function one(): MyClass
   {
       return new MyClass();
   }
   /**
    * 2
    */
   function two(): void
   {}
   ```
   
   The Actual code after pressing `shift `+ `ctrl `+ `i` in `tmp.php`
   ```
   <?php
   /**
    * 1
    */
   function one(): MyClass
   {
       return new MyClass();
   }
   /**
    * 2
    */
   
   
   use App\Helpers\MyClass;
   function two(): void
   {}
   ```
   
   The Expercted  code after pressing `shift `+ `ctrl `+ `i` in `tmp.php`
   
   ```
   <?php
   use App\Helpers\MyClass;
   /**
    * 1
    */
   function one(): MyClass
   {
       return new MyClass();
   }
   /**
    * 2
    */
   function two(): void
   {}
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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