DamImpr commented on PR #9431:
URL: https://github.com/apache/netbeans/pull/9431#issuecomment-4723041200

   > > > @DamImpr
   > > > BTW, should we consider adding also `self`? What do you think? 🤔
   > > 
   > > 
   > > @tmysik In my opinion, the `static` return type is more appropriate than 
`self` in this case. By creating the fluent setter with `return $this`, the 
return type will always be the actual type being called, precisely the reason 
why `static` was introduced as a return type.
   > 
   > I get it and agree. I meant more - should we return `self` for older PHP 
versions? Just an idea, maybe not so important or useful at all. Sorry for not 
being clear from the beginning.
   
   @tmysik  It certainly wouldn’t be a bad idea to add the logic that fluent 
setters in PHP 7.[0-4] have `self` as their return type. After all, the Symfony 
framework used to write fluent setters with `self` as the return type when 
creating entities, before PHP 8.0 was released (it has now, of course, replaced 
`self` with `static`)
   
   I’ll take the opportunity presented by this PR to do so. I’ll push the 
change as soon as possible.


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