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