Add DocComments for function parameters#21279
Add DocComments for function parameters#21279chschneider wants to merge 17 commits intophp:masterfrom
Conversation
|
Even if this harder to read syntax would be used, the return type/value cannot be commented. I personally do not support this feature. |
ext/reflection/tests/ReflectionParameter_getDocComment_basic.phpt
Outdated
Show resolved
Hide resolved
ext/reflection/tests/ReflectionParameter_getDocComment_basic.phpt
Outdated
Show resolved
Hide resolved
ext/reflection/tests/ReflectionParameter_getDocComment_basic.phpt
Outdated
Show resolved
Hide resolved
|
@chschneider Can you give this PR a fresh rebase onto the latest master to ensure the CI is current? |
TimWolla
left a comment
There was a problem hiding this comment.
Can you add a test case for:
<?php
class Foo {
public function __construct(
/** $foo */
public string $foo {
/** setter */
set(string $value /** $value */) {
}
}
) {}
}
to ensure that all the doc comments are correctly assigned if there's a property hook for constructor property promotion? The /** $foo */ should probably be applied to both the property and the parameter 🤔
|
@chschneider I've took the liberty to push one commit into your branch to add additional property hook test cases and simplify the implementation. The behavior is now consistent with properties where the doc comment needs to appear before the hooks (because there is no final delimiter for hooked properties). Please double-check if you agree with that change. |
61a6861 to
8e86c33
Compare
I like the simplification, looks good to me, thanks. |
This PR implements DocComment support for function parameters as proposed in
https://wiki.php.net/rfc/parameter-doccomments