Skip to content

Commit ba5cf95

Browse files
committed
refactor: $request->getMethod() always returns string value
1 parent f89f42a commit ba5cf95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

system/Router/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function __construct(RouteCollection $routes, ?Request $request = null)
126126
$this->controller = $this->collection->getDefaultController();
127127
$this->method = $this->collection->getDefaultMethod();
128128

129-
$this->collection->setHTTPVerb(strtolower($request->getMethod() ?? $_SERVER['REQUEST_METHOD']));
129+
$this->collection->setHTTPVerb(strtolower($request->getMethod()));
130130

131131
$this->translateURIDashes = $this->collection->shouldTranslateURIDashes();
132132

0 commit comments

Comments
 (0)