utypes allows the user to hook into type verification at function entry (params) and exit (return) and handle the verification in user land.
Additionally, utypes allows the verification of a function against an interface (Functional Interfaces).
function utypes\handler(callable $handler) : bool;
Calling utypes\handler
shall install the handler for the user, the prototype for the handler should be:
function (string $type, $value) : bool;
The handler should return true
if execution should continue (type verification passed), or false
if the engine should run normal verification.
function utypes\verify(callable $value, string $interface) : bool;
Should be called by handler to verify that the value conforms to the interface provided: The interface should be functional (have a single method).
See tests.