private function insertContextInAllowedExtensions($name)
    {
        if (!array_key_exists($name, $this->contexts)) {
            throw new \Exception('The context '.$name.' is not defined.');
        }

        $this->allowedExtensions = array_merge($this->contexts[$name], $this->allowedExtensions);
    }