getPaths()->get($this->normalizePath($route->getPath())); $methods = $route->getMethods() ?: Swagger::$METHODS; foreach ($methods as $method) { $method = strtolower($method); if (!in_array($method, Swagger::$METHODS)) { continue; } $operations[] = $path->getOperation($method); } return $operations; } private function normalizePath(string $path): string { if ('.{_format}' === substr($path, -10)) { $path = substr($path, 0, -10); } return $path; } }