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

Can property-read flied add the comment? #1165

Closed
biiiiiigmonster opened this issue Mar 1, 2021 · 3 comments
Closed

Can property-read flied add the comment? #1165

biiiiiigmonster opened this issue Mar 1, 2021 · 3 comments

Comments

@biiiiiigmonster
Copy link
Contributor

Summary

Thanks for the package!!!

I wanna add the comment with property-read field such as Magic get<name>Attribute

For example

class Users extends Model
{
    /**
     * @comment Get User's full name
     *
     * @return string
     */
    public function getFullNameAttribute(): string
    {
        return $this->first_name . ' ' .$this->last_name ;
    }
}

=>

/**
 * @property-read string $full_name Get User's full name
 * @mixin \Eloquent
 */
class Users extends Model
{
    /**
     * @comment Get User's full name
     *
     * @return string
     */
    public function getFullNameAttribute(): string
    {
        return $this->first_name . ' ' .$this->last_name ;
    }
}

add the comment at the back of the property-read field.

@mfn
Copy link
Collaborator

mfn commented Mar 4, 2021

LGTM, happy to receive PR with tests

@biiiiiigmonster
Copy link
Contributor Author

With pleasure, I'll tests and commit it later

@mfn
Copy link
Collaborator

mfn commented Mar 15, 2021

Implemented with #1168 and released via https://github.com/barryvdh/laravel-ide-helper/releases/tag/v2.9.1

@mfn mfn closed this as completed Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants