noelma opened a new issue, #5011:
URL: https://github.com/apache/netbeans/issues/5011

   ### Apache NetBeans version
   
   Apache NetBeans 15
   
   ### What happened
   
   When I format my PHP 7+ code
   Coalescing operators are aligned as ternary operators
   Currently:
   ![Capture d’écran du 2022-11-27 
09-48-36](https://user-images.githubusercontent.com/10517497/204126628-cbb62e01-d71e-4bb2-bdcf-05dc16726f48.png)
   
   Goal:
   ![Capture d’écran du 2022-11-27 
09-56-54](https://user-images.githubusercontent.com/10517497/204126942-4c959b4a-51d8-4fdd-bdf8-f4b62713018d.png)
   
   Or separate into 2 packing option:
   - coalescing operator
   - ternary operator
   
   ### How to reproduce
   
   - In `Tools` > `Options` > `Editor` > `Formatting` > `PHP(Wrapping)`
     ![Capture d’écran du 2022-11-27 
09-34-36](https://user-images.githubusercontent.com/10517497/204126581-ce948c9f-47b1-41d4-becd-64ee509ea662.png)
   - Use `Always` for the `Ternary Operator `option
   - And `Apply`
   - Insert the following code in a PHP file:
     ```php
     <?php
   
     $data = [
         'key_1' => 10,
         'key_2' => 100,
     ];
   
     $tenaryOperator = isset($data['key_1']) ? $data['key_1'] : 'default';
   
     $coalescingOperator = $data['key_1'] ?? 'default';
     ```
   - Apply formatting
   
   
   ### Did this work correctly in an earlier version?
   
   Apache NetBeans 15
   
   ### Operating System
   
   Linux version 5.15.0-53-generic running on amd64
   
   ### JDK
   
   8.0.2-ea; OpenJDK 64-Bit Server VM 18.0.2-ea+9-Ubuntu-222.04; Private Build
   
   ### Apache NetBeans packaging
   
   Apache NetBeans Snap Package
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No
   
   ### Code of Conduct
   
   Yes


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