src/DMS/Filter/Filters/Zend.php
public function getZendInstance($class, $options)
    {
        if (strpos($class, 'Zend\Filter') === false) {
            $class = "Zend\Filter\\".$class;
        }

        if (! class_exists($class)) {
            throw new InvalidZendFilterException("Could not find or autoload: $class");
        }

        try {
            new \ReflectionMethod($class, 'setOptions');

            $filter = new $class();
            $filter->setOptions($options);

            return $filter;
        } catch (\ReflectionException $e) {
            return new $class($options);
        }
    }
public function getZendInstance($class, $options)
    {
        if (strpos($class, 'Zend\Filter') === false) {
            $class = "Zend\Filter\\".$class;
        }

        if (! class_exists($class)) {
            throw new InvalidZendFilterException("Could not find or autoload: $class");
        }

        try {
            new \ReflectionMethod($class, 'setOptions');

            $filter = new $class();
            $filter->setOptions($options);

            return $filter;
        } catch (\ReflectionException $e) {
            return new $class($options);
        }
    }
public function getZendInstance ( $ class , $ options ) { if ( strpos ( $ class , 'Zend\Filter' ) === false ) { $ class = "Zend\Filter\\" . $ class ; } if ( ! class_exists ( $ class ) ) { throw new InvalidZendFilterException ( "Could not find or autoload: $class" ) ; } try { new \ ReflectionMethod ( $ class , 'setOptions' ) ; $ filter = new $ class ( ) ; $ filter -> setOptions ( $ options ) ; return $ filter ; } catch ( \ ReflectionException $ e ) { return new $ class ( $ options ) ; } }
Instantiates a configured Zend Filter, if it exists

@param string $class
@param array $options
@return \Zend\Filter\FilterInterface
@throws \DMS\Filter\Exception\InvalidZendFilterException
Instantiates a configured Zend Filter if it exists