DamImpr opened a new pull request, #9604:
URL: https://github.com/apache/netbeans/pull/9604

   In connection with the fix I made in PR 
[9395](https://github.com/apache/netbeans/pull/9395), which correctly resolved 
the issue with the return type in the constructor,  IDE still generates `return 
parent::__construct();` when overriding a parent constructor. .
   
   Although the return statement in the constructor does not actually cause a 
runtime error, I’d like to explain why I believe it is still incorrect to 
include it, and why I am submitting this PR:
   
   The RFC  “[Ensure correct signatures of magic 
methods](https://wiki.php.net/rfc/magic-methods-signature)” explicitly states 
that
    
   > __construct() and __destruct() remain unchanged and continue to permit no 
declared return type — not even void — because, as the rationale states: almost 
all languages, including PHP, do not have the concept of constructors and 
destructors that “return” anything upon completion of their execution.
   
   This is therefore the officially accepted source which establishes, at the 
level of the PHP language RFC, the principle that, conceptually, a constructor 
must not return anything.


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