original_string: 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];
      }
code: 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];
      }
code_tokens: 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 ] ; }
docstring: Validate with Validate method
  
  @param MethodInvocation  $invocation
  @param \ReflectionMethod $onValidate
  @param \ReflectionMethod $onFailure
  
  @throws \Exception
  
  @return bool|mixed|InvalidArgumentException
docstring_tokens: Validate with Validate method