injectableFactory = $injectableFactory; $this->metadata = $metadata; } public function create(string $method): Logout { $className = $this->getClassName($method); if (!$className) { throw new RuntimeException(); } return $this->injectableFactory->create($className); } public function isCreatable(string $method): bool { return (bool) $this->getClassName($method); } /** * @return ?class-string */ private function getClassName(string $method): ?string { return $this->metadata->get(['authenticationMethods', $method, 'logoutClassName']); } }