public function apply()
    {
        $filters   = $this->filters;
        $inputs    = $this->inputs;
        $assistant = $this->assistant;

        if (count($filters)) {
            foreach ($filters as $name => $filter) {
                
                // Allow filter to defined as array or pipe delimited string
                $rules = (is_array($filter)) ? $filter : explode('|', $filter);

                // At least a rule is set and the input
                // field exists.
                if (count($rules) and isset($inputs[$name])) {
                    foreach ($rules as $rule) {
                        $splitAt = strpos($rule, ':');

                        $argument = null;
                        if ($splitAt) {
                            $argument = substr($rule, $splitAt+1);
                            $rule = substr($rule, 0, $splitAt);
                        }

                        $rule = strtolower($rule);
                        $rule = str_replace('_', ' ', $rule);
                        $rule = str_replace(' ', '', ucwords($rule));

                        $method = 'filter'.$rule;

                        // Check if rule is defined as a class method.
                        if (method_exists($this, $method)) {
                            $inputs[$name] = $this->$method($inputs[$name], $argument);
                        }

                        // Check if ValidatorAssistant object has the same/custom filter defined
                        if ( $assistant && method_exists($assistant, $method)) {
                            $inputs[$name] = $assistant->$method($inputs[$name], $argument);
                        }
                    }
                }
            }
        }

        return $inputs;
    }
public function apply()
    {
        $filters   = $this->filters;
        $inputs    = $this->inputs;
        $assistant = $this->assistant;

        if (count($filters)) {
            foreach ($filters as $name => $filter) {
                
                // Allow filter to defined as array or pipe delimited string
                $rules = (is_array($filter)) ? $filter : explode('|', $filter);

                // At least a rule is set and the input
                // field exists.
                if (count($rules) and isset($inputs[$name])) {
                    foreach ($rules as $rule) {
                        $splitAt = strpos($rule, ':');

                        $argument = null;
                        if ($splitAt) {
                            $argument = substr($rule, $splitAt+1);
                            $rule = substr($rule, 0, $splitAt);
                        }

                        $rule = strtolower($rule);
                        $rule = str_replace('_', ' ', $rule);
                        $rule = str_replace(' ', '', ucwords($rule));

                        $method = 'filter'.$rule;

                        // Check if rule is defined as a class method.
                        if (method_exists($this, $method)) {
                            $inputs[$name] = $this->$method($inputs[$name], $argument);
                        }

                        // Check if ValidatorAssistant object has the same/custom filter defined
                        if ( $assistant && method_exists($assistant, $method)) {
                            $inputs[$name] = $assistant->$method($inputs[$name], $argument);
                        }
                    }
                }
            }
        }

        return $inputs;
    }
public function apply ( ) { $ filters = $ this -> filters ; $ inputs = $ this -> inputs ; $ assistant = $ this -> assistant ; if ( count ( $ filters ) ) { foreach ( $ filters as $ name => $ filter ) { // Allow filter to defined as array or pipe delimited string $ rules = ( is_array ( $ filter ) ) ? $ filter : explode ( '|' , $ filter ) ; // At least a rule is set and the input // field exists. if ( count ( $ rules ) and isset ( $ inputs [ $ name ] ) ) { foreach ( $ rules as $ rule ) { $ splitAt = strpos ( $ rule , ':' ) ; $ argument = null ; if ( $ splitAt ) { $ argument = substr ( $ rule , $ splitAt + 1 ) ; $ rule = substr ( $ rule , 0 , $ splitAt ) ; } $ rule = strtolower ( $ rule ) ; $ rule = str_replace ( '_' , ' ' , $ rule ) ; $ rule = str_replace ( ' ' , '' , ucwords ( $ rule ) ) ; $ method = 'filter' . $ rule ; // Check if rule is defined as a class method. if ( method_exists ( $ this , $ method ) ) { $ inputs [ $ name ] = $ this -> $ method ( $ inputs [ $ name ] , $ argument ) ; } // Check if ValidatorAssistant object has the same/custom filter defined if ( $ assistant && method_exists ( $ assistant , $ method ) ) { $ inputs [ $ name ] = $ assistant -> $ method ( $ inputs [ $ name ] , $ argument ) ; } } } } } return $ inputs ; }
Apply filters to the inputs.

@return array
Apply filters to the inputs .