public function sanitize($data)
    {
        if ($this->hasGlobals()) {
            if (! is_array($data)) {
                return $this->sanitizeValueFor(static::GLOBAL_KEY, $data);
            }

            foreach ($data as $key => $value) {
                $data[$key] = $this->sanitizeValueFor(static::GLOBAL_KEY, $value);
            }
        }

        foreach ($data as $key => $value) {
            if (! $this->shouldSanitize($key)) {
                continue;
            }

            $data[$key] = $this->sanitizeValueFor($key, $value);
        }

        return $data;
    }