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

Add return doc block to Collection property's getter method by ToMany attribute #317

Conversation

jszutkowski
Copy link
Contributor

@jszutkowski jszutkowski commented Jun 22, 2024

As in the title - I added a class, that based on the property's OneToMany or ManyToMany attribute, adds @return doc block to a getter method.
It adds the doc block only if method returns single property.
It also fixes invalid doc blocks like @return Collection<Entity> -> @return Collection<int, Entity>.

Any feedback appreciated

@jszutkowski jszutkowski changed the title Add return doc block to Collection property's getter method by ToMany… Add return doc block to Collection property's getter method by ToMany attribute Jun 22, 2024
@jszutkowski jszutkowski marked this pull request as draft June 22, 2024 11:20
@jszutkowski jszutkowski force-pushed the add-return-doc-block-by-property-attribute branch 3 times, most recently from 054c55c to d8bedf0 Compare June 22, 2024 11:47
@TomasVotruba
Copy link
Member

Thanks for improvement. I've been doing this manually so many time... great rule 👍

It's ready to go for me. How about you?

@jszutkowski
Copy link
Contributor Author

Good to go for me as well 👍 Do you think it's worth to have a similar rule that adds return type based on property's *ToMany annotation?

@TomasVotruba TomasVotruba merged commit e5736dd into rectorphp:main Jun 23, 2024
6 checks passed
@TomasVotruba
Copy link
Member

Let's ship it :)

I think that would be useful too 👏

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.

None yet

2 participants