private function handleCollections(Parameters $params, array $permitted = array())
    {
        // if is empty, any value is allowed
        if (empty($permitted)) {
            return;
        }

        $keys = $params->keys();
        $intKeys = $keys->select(function ($value) {
            return is_int($value);
        });

        if ($keys->count() === $intKeys->count()) {
            foreach ($keys as $key) {
                $value = $params[$key];

                if ($value instanceof Parameters) {
                    $this->filter($value, $permitted);
                }
            }
        }
    }