Apache NetBeans version
Apache NetBeans 28
What happened
When using the ‘generate override’ feature on a class that extends another class, and selecting the constructor, it is created by also assigning the return type, which is not permitted for a constructor.
Language / Project Type / NetBeans Component
PHP project
How to reproduce
- In a PHP project, create a class that extends another class.
- Right-click on the editor and select ‘Insert code’ to bring up the “Generate” menu, then select ‘Override & implement methods’.
- Select "__constructor", then press "Ok" button
- The constructor with return type is generated.
Did this work correctly in an earlier version?
No / Don't know
Operating System
Arch Linux
JDK
jdk21-openjdk
Apache NetBeans packaging
Community provided installer
Anything else
- The error shown in the screenshot was generated when running PHP version 8.3, but the same error also occurs in version 8.4.
- The bug does not occur when ‘Constructor’ is selected in the same ‘Generate’ menu.
Are you willing to submit a pull request?
Yes
Apache NetBeans version
Apache NetBeans 28
What happened
When using the ‘generate override’ feature on a class that extends another class, and selecting the constructor, it is created by also assigning the return type, which is not permitted for a constructor.
Language / Project Type / NetBeans Component
PHP project
How to reproduce
Did this work correctly in an earlier version?
No / Don't know
Operating System
Arch Linux
JDK
jdk21-openjdk
Apache NetBeans packaging
Community provided installer
Anything else
Are you willing to submit a pull request?
Yes