original_string: public function process($value, array $providers, array $context = [])
      {
          $context += ['data' => [], 'newRecord' => true, 'providers' => $providers];
  
          if ($this->_skip($context)) {
              return true;
          }
  
          if (!is_string($this->_rule) && is_callable($this->_rule)) {
              $callable = $this->_rule;
              $isCallable = true;
          } else {
              $provider = $providers[$this->_provider];
              $callable = [$provider, $this->_rule];
              $isCallable = is_callable($callable);
          }
  
          if (!$isCallable) {
              $message = 'Unable to call method "%s" in "%s" provider for field "%s"';
              throw new InvalidArgumentException(
                  sprintf($message, $this->_rule, $this->_provider, $context['field'])
              );
          }
  
          if ($this->_pass) {
              $args = array_values(array_merge([$value], $this->_pass, [$context]));
              $result = $callable(...$args);
          } else {
              $result = $callable($value, $context);
          }
  
          if ($result === false) {
              return $this->_message ?: false;
          }
  
          return $result;
      }
code: public function process($value, array $providers, array $context = [])
      {
          $context += ['data' => [], 'newRecord' => true, 'providers' => $providers];
  
          if ($this->_skip($context)) {
              return true;
          }
  
          if (!is_string($this->_rule) && is_callable($this->_rule)) {
              $callable = $this->_rule;
              $isCallable = true;
          } else {
              $provider = $providers[$this->_provider];
              $callable = [$provider, $this->_rule];
              $isCallable = is_callable($callable);
          }
  
          if (!$isCallable) {
              $message = 'Unable to call method "%s" in "%s" provider for field "%s"';
              throw new InvalidArgumentException(
                  sprintf($message, $this->_rule, $this->_provider, $context['field'])
              );
          }
  
          if ($this->_pass) {
              $args = array_values(array_merge([$value], $this->_pass, [$context]));
              $result = $callable(...$args);
          } else {
              $result = $callable($value, $context);
          }
  
          if ($result === false) {
              return $this->_message ?: false;
          }
  
          return $result;
      }
code_tokens: public function process ( $ value , array $ providers , array $ context = [ ] ) { $ context += [ 'data' => [ ] , 'newRecord' => true , 'providers' => $ providers ] ; if ( $ this -> _skip ( $ context ) ) { return true ; } if ( ! is_string ( $ this -> _rule ) && is_callable ( $ this -> _rule ) ) { $ callable = $ this -> _rule ; $ isCallable = true ; } else { $ provider = $ providers [ $ this -> _provider ] ; $ callable = [ $ provider , $ this -> _rule ] ; $ isCallable = is_callable ( $ callable ) ; } if ( ! $ isCallable ) { $ message = 'Unable to call method "%s" in "%s" provider for field "%s"' ; throw new InvalidArgumentException ( sprintf ( $ message , $ this -> _rule , $ this -> _provider , $ context [ 'field' ] ) ) ; } if ( $ this -> _pass ) { $ args = array_values ( array_merge ( [ $ value ] , $ this -> _pass , [ $ context ] ) ) ; $ result = $ callable ( ... $ args ) ; } else { $ result = $ callable ( $ value , $ context ) ; } if ( $ result === false ) { return $ this -> _message ? : false ; } return $ result ; }
docstring: Dispatches the validation rule to the given validator method and returns
  a boolean indicating whether the rule passed or not. If a string is returned
  it is assumed that the rule failed and the error message was given as a result.
  
  @param mixed $value The data to validate
  @param array $providers associative array with objects or class names that will
  be passed as the last argument for the validation method
  @param array $context A key value list of data that could be used as context
  during validation. Recognized keys are:
  - newRecord: (boolean) whether or not the data to be validated belongs to a
  new record
  - data: The full data that was passed to the validation process
  - field: The name of the field that is being processed
  @return bool|string
  @throws \InvalidArgumentException when the supplied rule is not a valid
  callable for the configured scope
docstring_tokens: Dispatches the validation rule to the given validator method and returns a boolean indicating whether the rule passed or not . If a string is returned it is assumed that the rule failed and the error message was given as a result .