protected function extractLocale(array &$url_array, Response $response) : void
    {
        if (count($url_array) > 0 && preg_match('/^([a-z0-9]{2,3})-([a-z0-9]{4}-?)?([a-z0-9]{2,3})?$/i',
                $url_array[0])) {
            $response->setLocale(array_shift($url_array));
        }
        reset($url_array);
    }