public function getLogoutPath(Request $request) { foreach ($this->map as $contextId => $requestMatcher) { if (null === $requestMatcher || $requestMatcher->matches($request)) { $key = str_replace('security.firewall.map.context.', '', $contextId, $count); if (!$count) { throw new \InvalidArgumentException('Not found '); } return $this->logout->getLogoutPath($key); } } return '/logout'; }