Defined by Zend\Filter\FilterInterface

Returns realpath($value)

If the value provided is non-scalar, the value will remain unfiltered

@param  string $value
@return string|mixed
163691
public function filter($value)
    {
        if (!is_string($value)) {
            return $value;
        }
        $path = (string) $value;

        if ($this->options['exists']) {
            return realpath($path);
        }

        ErrorHandler::start();
        $realpath = realpath($path);
        ErrorHandler::stop();
        if ($realpath) {
            return $realpath;
        }

        $drive = '';
        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
            $path = preg_replace('/[\\\\\/]/', DIRECTORY_SEPARATOR, $path);
            if (preg_match('/([a-zA-Z]\:)(.*)/', $path, $matches)) {
                list(, $drive, $path) = $matches;
            } else {
                $cwd   = getcwd();
                $drive = substr($cwd, 0, 2);
                if (substr($path, 0, 1) != DIRECTORY_SEPARATOR) {
                    $path = substr($cwd, 3) . DIRECTORY_SEPARATOR . $path;
                }
            }
        } elseif (substr($path, 0, 1) != DIRECTORY_SEPARATOR) {
            $path = getcwd() . DIRECTORY_SEPARATOR . $path;
        }

        $stack = [];
        $parts = explode(DIRECTORY_SEPARATOR, $path);
        foreach ($parts as $dir) {
            if (strlen($dir) && $dir !== '.') {
                if ($dir == '..') {
                    array_pop($stack);
                } else {
                    array_push($stack, $dir);
                }
            }
        }

        return $drive . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $stack);
    }
1127106
protected function filter($value, $filter)
    {
        if (null !== $filter) {
            $value = Filter::_($value, $filter);
        }

        return $value;
    }
95257
public function filter($value)
    {
        foreach($this->getFilters() as $index => $filter) {
            // Extract the params
            list($method, $params) = $filter;

            // If method is null, we use the index as the method name
            $method = is_null($method) ? $index : $method;

            // Build the params for the filter
            array_unshift($params, $value);

            // If it's a anonymous function
            if (!is_string($method) && is_callable($method)) {

                $value = call_user_func_array($method, $params);

                // if it's a local method
            } else {

                if (!method_exists($this, $method)) {
                    throw new \Exception('Method "'. $method .'" not found for filter : ' . $index);
                }

                $value = call_user_func_array([$this, $method], $params);
            }
        }

        return $value;
    }
19940
public function filter($value)
    {
        if (is_object($value) && ! method_exists($value, '__toString')) {
            return '';
        }

        if (is_array($value)) {
            $dummy = [
                'name' => '',
                'tmp_name' => '',
                'error' => UPLOAD_ERR_NO_FILE,
                'size' => 0,
                'type' => '',
            ];
            $value = ArrayUtils::merge($dummy, $value);
        } else {
            $value = (string) $value;
        }

        if (isset($value['error']) && $value['error'] !== UPLOAD_ERR_OK) {
            return '';
        }

        if ($this->options['use_uploaded_name'] && isset($value['name'])) {
            $value = $value['name'];
        } elseif (isset($value['tmp_name'])) {
            $value = $value['tmp_name'];
        }

        if ($this->options['basename']) {
            $value = basename($value);
        }

        return $value;
    }
743341
public function filter($value)
    {
        if (empty($value)) {
            return $value;
        }

        if ($value[0] == '$' && strlen($value) > 32) {
            return $value;
        }

        $this->createBcryptHash($value);

        return $value;
    }
1362359
public static function getReal($value)
    {
        $value     = (float)$value;
        $stringVal = (string)$value;
        if (!fmod($value, 1)) {
            $stringVal .= ".";
        }
        return $stringVal;
    }
738419
public function filter($value)
    {
        if (!is_scalar($value)) {
            return $value;
        }
        $value = (string) $value;

        return dirname($value);
    }
347486
public function filter($value)
    {
        if ($this->encodingFormat !== null) {
            return mb_strtolower($value, $this->encodingFormat);
        }

        return mb_strtolower($value);
    }
288669
public function filter($value)
    {
        /** @var InputFilterInterface $filter */
        foreach ($this->filters as $filter) {
            if (true === is_array($value)) {
                $values = array();
                foreach ($value as $child) {
                    if (null !== $filtered = $filter->filter($child)) {
                        $values[] = $filtered;
                    }
                }
                $value = $values;
            } else {
                $value = $filter->filter($value);
            }
        }

        return $value;
    }
893817
public function filterByValue($value)
    {
        $callback = function (BindingInterface $binding, $key) use ($value) {
            return $binding->getValue() == $value;
        };

        return $this->filter($callback);
    }
404293
private function filterPair($value)
    {
        if (null === $value || is_scalar($value)) {
            return $value;
        }

        if ($value instanceof UriComponentInterface) {
            return $value->getContent();
        }

        if (method_exists($value, '__toString')) {
            return (string) $value;
        }

        throw new TypeError('The submitted value is invalid.');
    }
990071
public function filterValue($value)
    {
        if ($value instanceof Element\AbstractElement) {
            $name      = $value->getName();
            $type      = $value->getType();
            $realValue = $value->getValue();
        } else {
            $type      = null;
            $name      = null;
            $realValue = $value;
        }
        foreach ($this->filters as $filter) {
            if (((null === $type) || (!in_array($type, $filter['excludeByType']))) &&
                ((null === $name) || (!in_array($name, $filter['excludeByName'])))) {
                if (is_array($realValue)) {
                    foreach ($realValue as $k => $v) {
                        $params        = array_merge([$v], $filter['params']);
                        $realValue[$k] = call_user_func_array($filter['call'], $params);
                    }
                } else {
                    $params    = array_merge([$realValue], $filter['params']);
                    $realValue = call_user_func_array($filter['call'], $params);
                }
            }
        }
        if (($value instanceof Element\AbstractElement) && (null !== $realValue) && ($realValue != '')) {
            $value->setValue($realValue);
        }
        return $realValue;
    }
629261
public function filter($value)
    {
	    if (is_string($value))
	        return new DateTime('@'.strtotime($value));
	    if ($value instanceof DateTime)
		    return $value;
	    if (is_int($value))
		    return new DateTime('@'.$value);
	    return null;
    }
696445
public function filter($value)
    {
        if (empty($value)) {
            return $value;
        }

        return number_format(floatval($value), $this->decimals, $this->decimalPoint, $this->thousandSeparator);
    }
850043
public function filter($value)
    {
        return str_getcsv($value, $this->delimiter, $this->enclosure, $this->escape);
    }
720412
public function filter($value)
    {
        if (! is_array($value)) {
            // nothing to do
            return $value;
        }

        // Convert the date to a specific format
        if ($this->isNullOnEmpty()
            && array_reduce($value, __CLASS__ . '::reduce', false)
        ) {
            return;
        }

        if ($this->isNullOnAllEmpty()
            && array_reduce($value, __CLASS__ . '::reduce', true)
        ) {
            return;
        }

        $this->filterable($value);

        ksort($value);
        $value = vsprintf($this->format, $value);

        return $value;
    }
993720
public function filter($value)
    {
        if (!is_string($value) && $value !== null) {
            return $value;
        }

        return $this->getAdapter()->decompress($value);
    }