How to enforce an array to match a class constructor #10821
-
I would like to ensure that in my array the arguments are correctly provided according to the class used. https://phpstan.org/r/df235b3a-5422-40e3-9d10-d9f53c7cf939 The code is not working as it's missing the second argument to the HelloWorld constructor |
Beta Was this translation helpful? Give feedback.
Answered by
ondrejmirtes
Apr 2, 2024
Replies: 1 comment
-
This is going to be possible in the future with this idea: https://twitter.com/OndrejMirtes/status/1606017239882338304 Until then you need to solve this either:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
momala454
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is going to be possible in the future with this idea: https://twitter.com/OndrejMirtes/status/1606017239882338304
Until then you need to solve this either: