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

Chapter 16 to be updated with php's typehinting and return types? #975

Open
svdv22 opened this issue Apr 14, 2023 · 3 comments
Open

Chapter 16 to be updated with php's typehinting and return types? #975

svdv22 opened this issue Apr 14, 2023 · 3 comments
Labels
feedback-needed We need feedback on this issue

Comments

@svdv22
Copy link
Contributor

svdv22 commented Apr 14, 2023

Now that PHP supports typehinting and return types the @param, @return and also @throws documentations are obsolete. Explaining these would be outside the scope of that chapter, but personally I would not advice to still use them. Perhaps limit the chapter to just the example of @author and @link with a link to phpDocumentor.
What are your thoughts?

@SandroMiguel
Copy link

I do not agree, especially with @param because you can provide a description which can be helpful in cases where the type hint alone does not provide enough information about the expected parameter value.

@Xymph Xymph added the feedback-needed We need feedback on this issue label Apr 14, 2023
@svdv22
Copy link
Contributor Author

svdv22 commented Apr 14, 2023

In my experience the combination of typehint + variable name is almost always enough. If not, I could see the added value of @param with a description. Conclusion could be to change the chapter explaining that. But as the chapter stands now It feels a little outdated to me.

@Xymph
Copy link
Collaborator

Xymph commented Apr 16, 2023

To get (more) meaningful results out of phpDocumentor, ApiGen, and the like (which is what the chapter is about), the @ tags are useful or even necessary. But you could clarify that purely for code commenting without using those tools, type hinting could suffice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback-needed We need feedback on this issue
Projects
None yet
Development

No branches or pull requests

3 participants