Danack / Params

Framework agnostic validation
MIT License
6 stars 1 forks source link

Better missing param info. #11

Closed Danack closed 2 years ago

Danack commented 3 years ago

Currently, it may be hard to spot typos when the constructor param name is slightly different from the available param name. Think backgroundColor vs background_color. Both look correct in isolation.

             throw MissingConstructorParameterNameException::missingParam(
                 $classname,
-                $name
+                $name . "available are: " . implode(", ", array_keys($values))
             );
Danack commented 2 years ago

This is no longer relevant. The input name and name used by the type being created are no longer the same.