ArgumentResolver icon indicating copy to clipboard operation
ArgumentResolver copied to clipboard

[POC] Validate for extra arguments

Open dantleech opened this issue 7 years ago • 0 comments

This PR will make this library throw an exception if redundant arguments are given to the resolver.

e.g.

public function foobar($a, $b) {}
$resolver->resolveArguments('a' => 1, 'b' => 2, 'c' => 3);

:boom: The following arguments are not known: "c", known arguments: "a", "b"'

This is really very good for ensuring that both programmer typos and user typos do not silently miss their targets.

This is just a POC as I don't know if you want this in the library or not (and I have https://gitlab.com/dantleech/argument-resolver standing by otherwise).

dantleech avatar Jul 02 '18 19:07 dantleech