src/tValidator.php
final function assertValidate()
    {
        $exceptions = $this->doAssertValidate();
        if (!is_array($exceptions))
            throw new \RuntimeException(sprintf(
                'Unknown Validation Assertion Value Of Type Array (%s).'
                , flatten($exceptions)
            ));

        if ( empty($exceptions) )
            return;


        // Chain Exception:

        // TODO what if assertValidator or exceptions list has \Exception instance instead of exUnexpected

        $_f__chainExceptions = function (exUnexpectedValue $ex, &$list) use (&$_f__chainExceptions)
        {
            if ( empty($list) )
                return $ex;

            /** @var exUnexpectedValue $exception */
            $exception = array_pop($list);

            $r = new exUnexpectedValue(
                $exception->getMessage()
                , $exception->getParameterName()
                , $exception->getError()
                , $_f__chainExceptions($ex, $list)
            );

            return $r;
        };

        $ex = $_f__chainExceptions(new exUnexpectedValue('Validation Error', null), $exceptions);
        throw $ex;
    }
final function assertValidate()
    {
        $exceptions = $this->doAssertValidate();
        if (!is_array($exceptions))
            throw new \RuntimeException(sprintf(
                'Unknown Validation Assertion Value Of Type Array (%s).'
                , flatten($exceptions)
            ));

        if ( empty($exceptions) )
            return;


        // Chain Exception:

        // TODO what if assertValidator or exceptions list has \Exception instance instead of exUnexpected

        $_f__chainExceptions = function (exUnexpectedValue $ex, &$list) use (&$_f__chainExceptions)
        {
            if ( empty($list) )
                return $ex;

            /** @var exUnexpectedValue $exception */
            $exception = array_pop($list);

            $r = new exUnexpectedValue(
                $exception->getMessage()
                , $exception->getParameterName()
                , $exception->getError()
                , $_f__chainExceptions($ex, $list)
            );

            return $r;
        };

        $ex = $_f__chainExceptions(new exUnexpectedValue('Validation Error', null), $exceptions);
        throw $ex;
    }
final function assertValidate ( ) { $ exceptions = $ this -> doAssertValidate ( ) ; if ( ! is_array ( $ exceptions ) ) throw new \ RuntimeException ( sprintf ( 'Unknown Validation Assertion Value Of Type Array (%s).' , flatten ( $ exceptions ) ) ) ; if ( empty ( $ exceptions ) ) return ; // Chain Exception: // TODO what if assertValidator or exceptions list has \Exception instance instead of exUnexpected $ _f__chainExceptions = function ( exUnexpectedValue $ ex , & $ list ) use ( & $ _f__chainExceptions ) { if ( empty ( $ list ) ) return $ ex ; /** @var exUnexpectedValue $exception */ $ exception = array_pop ( $ list ) ; $ r = new exUnexpectedValue ( $ exception -> getMessage ( ) , $ exception -> getParameterName ( ) , $ exception -> getError ( ) , $ _f__chainExceptions ( $ ex , $ list ) ) ; return $ r ; } ; $ ex = $ _f__chainExceptions ( new exUnexpectedValue ( 'Validation Error' , null ) , $ exceptions ) ; throw $ ex ; }
Assert Validate Entity

@throws exUnexpectedValue
Assert Validate Entity