original_string: public function apply($value, $type = self::TYPE_STRING, array $filters = array(), $title = null, $required = true)
      {
          $result = $this->validate($value, $type, $filters, $title, $required);
  
          if ($result->hasError()) {
              throw new ValidationException($result->getFirstError(), $title, $result);
          } elseif ($result->isSuccessful()) {
              return $result->getValue();
          }
  
          return null;
      }
code: public function apply($value, $type = self::TYPE_STRING, array $filters = array(), $title = null, $required = true)
      {
          $result = $this->validate($value, $type, $filters, $title, $required);
  
          if ($result->hasError()) {
              throw new ValidationException($result->getFirstError(), $title, $result);
          } elseif ($result->isSuccessful()) {
              return $result->getValue();
          }
  
          return null;
      }
code_tokens: public function apply ( $ value , $ type = self :: TYPE_STRING , array $ filters = array ( ) , $ title = null , $ required = true ) { $ result = $ this -> validate ( $ value , $ type , $ filters , $ title , $ required ) ; if ( $ result -> hasError ( ) ) { throw new ValidationException ( $ result -> getFirstError ( ) , $ title , $ result ) ; } elseif ( $ result -> isSuccessful ( ) ) { return $ result -> getValue ( ) ; } return null ; }
docstring: Applies filter on the given value and returns the value on success or
  throws an exception if an error occured
  
  @param string $value
  @param string $type
  @param \PSX\Validate\FilterInterface[]|callable $filters
  @param string $title
  @param boolean $required
  @return mixed
docstring_tokens: Applies filter on the given value and returns the value on success or throws an exception if an error occured