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;
    }
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;
    }
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 ; }
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
Applies filter on the given value and returns the value on success or throws an exception if an error occured