src/Schema.php
private function callFilters($value, ValidationField $field, bool &$validated = false) {
        // Strip array references in the name except for the last one.
        $key = $field->getSchemaPath();
        if (!empty($this->filters[$key])) {
            foreach ($this->filters[$key] as list($filter, $validate)) {
                $value = call_user_func($filter, $value, $field);
                $validated |= $validate;

                if (Invalid::isInvalid($value)) {
                    return $value;
                }
            }
        }
        $key = '/format/'.$field->val('format');
        if (!empty($this->filters[$key])) {
            foreach ($this->filters[$key] as list($filter, $validate)) {
                $value = call_user_func($filter, $value, $field);
                $validated |= $validate;

                if (Invalid::isInvalid($value)) {
                    return $value;
                }
            }
        }

        return $value;
    }
private function callFilters($value, ValidationField $field, bool &$validated = false) {
        // Strip array references in the name except for the last one.
        $key = $field->getSchemaPath();
        if (!empty($this->filters[$key])) {
            foreach ($this->filters[$key] as list($filter, $validate)) {
                $value = call_user_func($filter, $value, $field);
                $validated |= $validate;

                if (Invalid::isInvalid($value)) {
                    return $value;
                }
            }
        }
        $key = '/format/'.$field->val('format');
        if (!empty($this->filters[$key])) {
            foreach ($this->filters[$key] as list($filter, $validate)) {
                $value = call_user_func($filter, $value, $field);
                $validated |= $validate;

                if (Invalid::isInvalid($value)) {
                    return $value;
                }
            }
        }

        return $value;
    }
private function callFilters ( $ value , ValidationField $ field , bool & $ validated = false ) { // Strip array references in the name except for the last one. $ key = $ field -> getSchemaPath ( ) ; if ( ! empty ( $ this -> filters [ $ key ] ) ) { foreach ( $ this -> filters [ $ key ] as list ( $ filter , $ validate ) ) { $ value = call_user_func ( $ filter , $ value , $ field ) ; $ validated |= $ validate ; if ( Invalid :: isInvalid ( $ value ) ) { return $ value ; } } } $ key = '/format/' . $ field -> val ( 'format' ) ; if ( ! empty ( $ this -> filters [ $ key ] ) ) { foreach ( $ this -> filters [ $ key ] as list ( $ filter , $ validate ) ) { $ value = call_user_func ( $ filter , $ value , $ field ) ; $ validated |= $ validate ; if ( Invalid :: isInvalid ( $ value ) ) { return $ value ; } } } return $ value ; }
Call all of the filters attached to a field.

@param mixed $value The field value being filtered.
@param ValidationField $field The validation object.
@param bool $validated Whether or not a filter validated the field.
@return mixed Returns the filtered value. If there are no filters for the field then the original value is returned.
Call all of the filters attached to a field .