You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "DamImpr (via GitHub)" <gi...@apache.org> on 2026/01/28 15:05:42 UTC
[I] [PHP] 'Generate override' feature assigns the return type in the constructor [netbeans]
DamImpr opened a new issue, #9171:
URL: https://github.com/apache/netbeans/issues/9171
### 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.
<img width="998" height="212" alt="Image" src="https://github.com/user-attachments/assets/c0550194-1276-42ab-a9cc-aba9d126afaa" />
<img width="2026" height="89" alt="Image" src="https://github.com/user-attachments/assets/323f004a-f7b0-4fc4-b2cb-cb64686e59e8" />
### Language / Project Type / NetBeans Component
PHP project
### How to reproduce
1. In a PHP project, create a class that extends another class ( .
<img width="451" height="130" alt="Image" src="https://github.com/user-attachments/assets/bf8218f3-7e35-4dff-9c31-cd04440b3343" />
2. Right-click on the editor and select ‘Insert code’ to bring up the “Generate” menu, then select ‘Override & implement methods’.
<img width="609" height="330" alt="Image" src="https://github.com/user-attachments/assets/4b741f18-ffb4-4775-8bfe-e7d8620fd7a4" />
3. Select "__constructor", then press "Ok" button
<img width="795" height="671" alt="Image" src="https://github.com/user-attachments/assets/2d5d8560-028a-42e3-8915-c594e88d8322" />
4. The constructor with return type is generated.
<img width="1134" height="205" alt="Image" src="https://github.com/user-attachments/assets/f91974c2-378f-4c01-bb0f-742b4b47e038" />
### 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.
<img width="427" height="214" alt="Image" src="https://github.com/user-attachments/assets/6d0a25fd-4798-412f-910e-7c21cfbcd4f1" />
<img width="357" height="199" alt="Image" src="https://github.com/user-attachments/assets/4e6ae4c3-4948-4131-9717-edf7d2f446d9" />
### Are you willing to submit a pull request?
No
--
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: notifications-unsubscribe@netbeans.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] [PHP] 'Generate override' feature assigns the return type in the constructor [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing closed issue #9171: [PHP] 'Generate override' feature assigns the return type in the constructor
URL: https://github.com/apache/netbeans/issues/9171
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists