Skip to content

How to enforce an array to match a class constructor #10821

Closed Answered by ondrejmirtes
momala454 asked this question in Support
Discussion options

You must be logged in to vote

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:

  1. By implementing a custom rule
  2. By implementing the linked idea using this approach: https://phpstan.org/developing-extensions/custom-phpdoc-types

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by momala454
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants