Airship\Engine\Security\Filter\StringFilter::applyCallbacks PHP Method

applyCallbacks() public method

Apply all of the callbacks for this filter.
public applyCallbacks ( mixed $data = null, integer $offset ) : mixed
$data mixed
$offset integer
return mixed
    public function applyCallbacks($data = null, int $offset = 0)
    {
        if ($offset === 0) {
            if (!empty($this->pattern)) {
                if (!\preg_match($this->pattern, $data)) {
                    throw new \TypeError(\sprintf('Pattern match failed (%s).', $this->index));
                }
            }
            return parent::applyCallbacks($data, 0);
        }
        return parent::applyCallbacks($data, $offset);
    }