Skip to content

Add DocComments for function parameters#21279

Open
chschneider wants to merge 16 commits intophp:masterfrom
chschneider:parameter-doccomments
Open

Add DocComments for function parameters#21279
chschneider wants to merge 16 commits intophp:masterfrom
chschneider:parameter-doccomments

Conversation

@chschneider
Copy link
Copy Markdown
Contributor

This PR implements DocComment support for function parameters as proposed in
https://wiki.php.net/rfc/parameter-doccomments

@mvorisek
Copy link
Copy Markdown
Contributor

Even if this harder to read syntax would be used, the return type/value cannot be commented. I personally do not support this feature.

Copy link
Copy Markdown
Member

@DanielEScherzer DanielEScherzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking better

@TimWolla
Copy link
Copy Markdown
Member

@chschneider Can you give this PR a fresh rebase onto the latest master to ensure the CI is current?

Copy link
Copy Markdown
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants