helpers/Validator.php
public static function validate($result, array $context)
    {
        if (!empty($context['parent'])) {
            if (!($result instanceof $context['parent'])) {
                throw new InvalidPointer('Object must be an instance of '.$context['parent']);
            }
        }
        if (!empty($context['validator'])) {
            if (!Callback::call($context['validator'], [$result])) {
                throw new InvalidPointer('Object is not valid');
            }
        }
        return true;
    }
public static function validate($result, array $context)
    {
        if (!empty($context['parent'])) {
            if (!($result instanceof $context['parent'])) {
                throw new InvalidPointer('Object must be an instance of '.$context['parent']);
            }
        }
        if (!empty($context['validator'])) {
            if (!Callback::call($context['validator'], [$result])) {
                throw new InvalidPointer('Object is not valid');
            }
        }
        return true;
    }
public static function validate ( $ result , array $ context ) { if ( ! empty ( $ context [ 'parent' ] ) ) { if ( ! ( $ result instanceof $ context [ 'parent' ] ) ) { throw new InvalidPointer ( 'Object must be an instance of ' . $ context [ 'parent' ] ) ; } } if ( ! empty ( $ context [ 'validator' ] ) ) { if ( ! Callback :: call ( $ context [ 'validator' ] , [ $ result ] ) ) { throw new InvalidPointer ( 'Object is not valid' ) ; } } return true ; }
Checks a result

@param mixed $result
the result of creating
@param array $context
the context of the creator
@return boolean
@throws \axy\creator\errors\InvalidPointer
Checks a result