private function validate(MethodInvocation $invocation, \ReflectionMethod $onValidate, \ReflectionMethod $onFailure = null)
    {
        $validation = $onValidate->invokeArgs($invocation->getThis(), (array) $invocation->getArguments());
        if ($validation instanceof Validation && $validation->getMessages()) {
            /* @var $validation Validation */
            $validation->setInvocation($invocation);
            $failure = $this->getFailure($invocation, $validation, $onFailure);
            if ($failure instanceof \Exception) {
                throw $failure;
            }

            return [false, $failure];
        }

        return [true, null];
    }
private function validate(MethodInvocation $invocation, \ReflectionMethod $onValidate, \ReflectionMethod $onFailure = null)
    {
        $validation = $onValidate->invokeArgs($invocation->getThis(), (array) $invocation->getArguments());
        if ($validation instanceof Validation && $validation->getMessages()) {
            /* @var $validation Validation */
            $validation->setInvocation($invocation);
            $failure = $this->getFailure($invocation, $validation, $onFailure);
            if ($failure instanceof \Exception) {
                throw $failure;
            }

            return [false, $failure];
        }

        return [true, null];
    }
private function validate ( MethodInvocation $ invocation , \ ReflectionMethod $ onValidate , \ ReflectionMethod $ onFailure = null ) { $ validation = $ onValidate -> invokeArgs ( $ invocation -> getThis ( ) , ( array ) $ invocation -> getArguments ( ) ) ; if ( $ validation instanceof Validation && $ validation -> getMessages ( ) ) { /* @var $validation Validation */ $ validation -> setInvocation ( $ invocation ) ; $ failure = $ this -> getFailure ( $ invocation , $ validation , $ onFailure ) ; if ( $ failure instanceof \ Exception ) { throw $ failure ; } return [ false , $ failure ] ; } return [ true , null ] ; }
Validate with Validate method

@param MethodInvocation  $invocation
@param \ReflectionMethod $onValidate
@param \ReflectionMethod $onFailure

@throws \Exception

@return bool|mixed|InvalidArgumentException
Validate with Validate method