Skip to content

Commit 430aa84

Browse files
committed
fix: remove unreachable duplicate OPTIONS handling block
The elseif branch for REQUEST_METHOD_OPTIONS at line 661 was dead code — OPTIONS requests are already handled and returned earlier (lines 628-657). Removing the duplicate simplifies the control flow. https://claude.ai/code/session_0196tmVsX1KjJKmuHncp7HiV
1 parent eae308a commit 430aa84

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

src/Http/Http.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -658,30 +658,6 @@ protected function runInternal(Container $container, ?Route $route): static
658658

659659
if (null !== $route) {
660660
return $this->lifecycle($route, $request, $container);
661-
} elseif (self::REQUEST_METHOD_OPTIONS == $method) {
662-
try {
663-
foreach ($groups as $group) {
664-
foreach (self::$options as $option) { // Group options hooks
665-
if (in_array($group, $option->getGroups())) {
666-
$this->executeHook($this->prepare($container, $option, [], $request->getParams()), $option);
667-
}
668-
}
669-
}
670-
671-
foreach (self::$options as $option) { // Global options hooks
672-
if (in_array('*', $option->getGroups())) {
673-
$this->executeHook($this->prepare($container, $option, [], $request->getParams()), $option);
674-
}
675-
}
676-
} catch (\Throwable $e) {
677-
foreach (self::$errors as $error) { // Global error hooks
678-
if (in_array('*', $error->getGroups())) {
679-
$container->set('error', fn () => $e);
680-
681-
$this->executeHook($this->prepare($container, $error, [], $request->getParams()), $error);
682-
}
683-
}
684-
}
685661
} else {
686662
foreach (self::$errors as $error) { // Global error hooks
687663
if (in_array('*', $error->getGroups())) {

0 commit comments

Comments
 (0)