public static function addFilter($name, $filter)
    {
        $key = self::normalizeFilterName($name);

        if (isset(self::$filters[$key])) {
            throw new PhugException(
                'Filter '.$name.' is already set.'
            );
        }

        self::setFilter($name, $filter);
    }
public static function addFilter($name, $filter)
    {
        $key = self::normalizeFilterName($name);

        if (isset(self::$filters[$key])) {
            throw new PhugException(
                'Filter '.$name.' is already set.'
            );
        }

        self::setFilter($name, $filter);
    }
public static function addFilter ( $ name , $ filter ) { $ key = self :: normalizeFilterName ( $ name ) ; if ( isset ( self :: $ filters [ $ key ] ) ) { throw new PhugException ( 'Filter ' . $ name . ' is already set.' ) ; } self :: setFilter ( $ name , $ filter ) ; }
Add a filter. Throws an exception if the name is already taken.

@param string          $name
@param callable|string $filter

@throws PhugException
Add a filter . Throws an exception if the name is already taken .