Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reference in method tag #332

Merged
merged 1 commit into from
Apr 2, 2022
Merged

Support reference in method tag #332

merged 1 commit into from
Apr 2, 2022

Conversation

villfa
Copy link
Contributor

@villfa villfa commented Mar 31, 2022

This PR makes the following docblock parseable:

/**
 * @method &foo()
 */
class Test
{
    public $values = [];
    public function &__call($name, $args)
    {
        $this->values[$name] ??= null;
        return $this->values[$name];
    }
}

See this sample in action: https://3v4l.org/CXuLL

The Method class has now a method returnsReference(): bool. This name comes from ReflectionFunctionAbstract::returnsReference.

Copy link
Member

@jaapio jaapio left a comment

Choose a reason for hiding this comment

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

Thanks this looks good.

@jaapio jaapio merged commit dd9861e into phpDocumentor:master Apr 2, 2022
@villfa villfa deleted the feat/returns-reference branch April 2, 2022 20:32
@villfa
Copy link
Contributor Author

villfa commented Apr 2, 2022

Thanks @jaapio for accepting this change.
Would it ok to make a new release? I plan to use it for another PR to phpDocumentor.

@jaapio
Copy link
Member

jaapio commented Apr 2, 2022

I'm ok to get an PR on phpDocumentor using a dev version of this library, if that helps you to prepare a new PR :-)

I hope I will have some more time next week to finalize some open PR's in this repo before creating a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants