Replies: 1 comment 1 reply
-
You can use type aliases: https://phpstan.org/writing-php-code/phpdoc-types#local-type-aliases |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I have a question about using arrays as parameters and reusing their shapes. Is there any way to borrow the shape (to refer to a tag from the different annotation) of an array that is passed as a parameter?
What do I mean by that. Sometimes, I come across the code like this:
As we can see from this code, the
initOptions()
method uses the same array shape as theconstructor
. ThedoSomething()
method uses the same array shape as theoptions
field. And this duplication is quite unwieldy and wordy to me.Is there any possibility to use some special tags or other techniques that allow us just to refer to a specific shape?
Beta Was this translation helpful? Give feedback.
All reactions