[PHP] Return type changed in PHP >= 8-0. Fluent setters now return static.#9431
[PHP] Return type changed in PHP >= 8-0. Fluent setters now return static.#9431DamImpr wants to merge 1 commit into
static.#9431Conversation
static.static.
matthiasblaesing
left a comment
There was a problem hiding this comment.
In general makes sense to me. I left an inline comment, regarding an unintentional change?!
@tmysik could you please have a look?
|
@matthiasblaesing I will look into it tomorrow. |
tmysik
left a comment
There was a problem hiding this comment.
Overall, it looks good to me, thank you for your work.
Just as requested in one of my comments, please add a link to the official PHP documentation describing this feature. This is always useful. Once we verify it, we are good to merge (once my comments are fixed too).
Thank you!
|
thank you @tmysik thank you |
b4c1031 to
e812432
Compare
|
@matthiasblaesing @tmysik |
|
@DamImpr, thanks for your changes, but see my comment above - we need the official PHP documentation of this feature/change so we are correct from the implementation/support point of view. Thank you for understanding. |
|
@tmysik Let me have a look in the official PHP documentation, in the section on the |
tmysik
left a comment
There was a problem hiding this comment.
Doc: https://wiki.php.net/rfc/static_return_type
Approving, thank you for your work.
|
BTW, should we consider adding also |
@tmysik In my opinion, the |
I get it and agree. I meant more - should we return |
@tmysik It certainly wouldn’t be a bad idea to add the logic that fluent setters in PHP 7.[0-4] have I’ll take the opportunity presented by this PR to do so. I’ll push the change as soon as possible. |
From PHP version 8.0 onwards, the "static" return type has been adopted for fluent setters. In the "Generate Code" menu in NetBeans, no return type was assigned when fluent setters were created. This PR ensures that fluent setters, when used in a project configured with PHP version >= 8.0, correctly have the "static" return type.