src/Anonym/Security/TypeHint.php
public static function handle($errLevel, $errMessage)
    {

        if ($errLevel === E_RECOVERABLE_ERROR) {

            if ($explode = explode(' ', $errMessage)) {

                if (
                    $explode[0] === 'Argument' &&
                    $explode[2] === 'passed' &&
                    $explode[3] === 'to' &&
                    $explode[5] === 'must' &&
                    $explode[20] === 'defined'
                ) {
                    $arg = $explode[1] - 1;
                    $mustType = $explode[10];
                    $back = debug_backtrace()[1];
                    $explode = explode('\\', $mustType);
                    $end = end($explode);
                    $getLastType = rtrim($end, ',');
                    $args = $back['args'];
                    $arg = $args[$arg];
                    if (gettype($arg) != $getLastType) {
                        if (call_user_func(static::$types[$getLastType], $arg)) {
                            return true;
                        } else {
                            return false;
                        }
                    } else {
                        return true;
                    }
                } else {
                    return false;
                }
            }
        } else {
            return false;
        }
    }
public static function handle($errLevel, $errMessage)
    {

        if ($errLevel === E_RECOVERABLE_ERROR) {

            if ($explode = explode(' ', $errMessage)) {

                if (
                    $explode[0] === 'Argument' &&
                    $explode[2] === 'passed' &&
                    $explode[3] === 'to' &&
                    $explode[5] === 'must' &&
                    $explode[20] === 'defined'
                ) {
                    $arg = $explode[1] - 1;
                    $mustType = $explode[10];
                    $back = debug_backtrace()[1];
                    $explode = explode('\\', $mustType);
                    $end = end($explode);
                    $getLastType = rtrim($end, ',');
                    $args = $back['args'];
                    $arg = $args[$arg];
                    if (gettype($arg) != $getLastType) {
                        if (call_user_func(static::$types[$getLastType], $arg)) {
                            return true;
                        } else {
                            return false;
                        }
                    } else {
                        return true;
                    }
                } else {
                    return false;
                }
            }
        } else {
            return false;
        }
    }
public static function handle ( $ errLevel , $ errMessage ) { if ( $ errLevel === E_RECOVERABLE_ERROR ) { if ( $ explode = explode ( ' ' , $ errMessage ) ) { if ( $ explode [ 0 ] === 'Argument' && $ explode [ 2 ] === 'passed' && $ explode [ 3 ] === 'to' && $ explode [ 5 ] === 'must' && $ explode [ 20 ] === 'defined' ) { $ arg = $ explode [ 1 ] - 1 ; $ mustType = $ explode [ 10 ] ; $ back = debug_backtrace ( ) [ 1 ] ; $ explode = explode ( '\\' , $ mustType ) ; $ end = end ( $ explode ) ; $ getLastType = rtrim ( $ end , ',' ) ; $ args = $ back [ 'args' ] ; $ arg = $ args [ $ arg ] ; if ( gettype ( $ arg ) != $ getLastType ) { if ( call_user_func ( static :: $ types [ $ getLastType ] , $ arg ) ) { return true ; } else { return false ; } } else { return true ; } } else { return false ; } } } else { return false ; } }
handle the error

@param integer $errLevel the level of error
@param string $errMessage the message of error
@return bool true on success, if failure happen return false
handle the error