For properties that are supposed to be objects, if the user passes a scalar, the array_key_exists method in BaseNode::walk() raises a type error instead of an invalid input exception.
Sample code:
class Handler extends InputHandler
{
public function define()
{
$this->add('endpoint', Endpoint::class, [
'required' => true,
'handler' => new EndPointHandler(),
'instantiator' => new EndPointInstantiator(),
]);
}
}
Sample input:
{
"endpoint": "https://local.liniopay.com",
}
Actual error raised:
{
"exception_class":"TypeError",
"exception_message":"array_key_exists() expects parameter 2 to be array, string given",
"exception_code":0,"exception_file":"/vagrant/vendor/linio/input/src/Node/BaseNode.php",
"exception_line":214
}