original_string: public function validate($context = 'default', array $data = [])
      {
          if (!empty($data)) {
              $this->setData($data);
          }
  
          $this->setContext($context);
          $rules = $this->buildRulesArray();
          $validator = $this->factory->make($this->filterArray($rules, $this->data), $rules);
          if ($validator->passes()) {
              return $validator->getData();
          }
          throw new ValidationException($validator);
      }
code: public function validate($context = 'default', array $data = [])
      {
          if (!empty($data)) {
              $this->setData($data);
          }
  
          $this->setContext($context);
          $rules = $this->buildRulesArray();
          $validator = $this->factory->make($this->filterArray($rules, $this->data), $rules);
          if ($validator->passes()) {
              return $validator->getData();
          }
          throw new ValidationException($validator);
      }
code_tokens: public function validate ( $ context = 'default' , array $ data = [ ] ) { if ( ! empty ( $ data ) ) { $ this -> setData ( $ data ) ; } $ this -> setContext ( $ context ) ; $ rules = $ this -> buildRulesArray ( ) ; $ validator = $ this -> factory -> make ( $ this -> filterArray ( $ rules , $ this -> data ) , $ rules ) ; if ( $ validator -> passes ( ) ) { return $ validator -> getData ( ) ; } throw new ValidationException ( $ validator ) ; }
docstring: Validate passed data
  
  @param string $context Validation context
  @param array  $data    Data to validate
  
  @throws InvalidArgumentException
  @throws ValidationException
  
  @return array
docstring_tokens: Validate passed data