Missing parameter in generic service locator example #10846
Closed
mindplay-dk
started this conversation in
General
Replies: 1 comment
-
There's no need to repeat it in PHPDoc, the parameter already has native string type. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm looking at the example in the article here:
phpstan/website/src/_posts/generics-by-examples.md
Lines 175 to 208 in 2d23fcc
I wonder if you intentionally omitted the
@param
entirely in the second example?I would have expected something like:
As the first paragraph says,
string|class-string<T>
would get normalized tostring
, so presumably the right type to use isstring $name
?So maybe it was omitted because it's redundant with the literal
string $name
parameter?Either way, it would have been nice to see it there, so you could more easily spot the difference between the two examples, and so you'd know what to write if you wanted to add documentation.
Beta Was this translation helpful? Give feedback.
All reactions