Skip to content

Commit c4fee2d

Browse files
committed
feat: move variables closer to used place
1 parent 3cc538a commit c4fee2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Context/ApiContext.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,16 @@ public function iSendRequestToRoute(
128128
string $route
129129
): void {
130130
$routeParams = $this->popRouteAttributesFromRequestParams($route, $this->requestParams);
131-
$postFields = [];
132-
$queryString = '';
133131

134132
$url = $this->router->generate($route, $routeParams);
135133
$url = preg_replace('|^/app[^\.]*\.php|', '', $url);
136134

135+
$queryString = '';
137136
if (Request::METHOD_GET === $method) {
138137
$queryString = http_build_query($this->requestParams);
139138
}
140139

140+
$postFields = [];
141141
if (in_array($method, [Request::METHOD_POST, Request::METHOD_PATCH, Request::METHOD_PUT, Request::METHOD_DELETE], true)) {
142142
$postFields = $this->requestParams;
143143
}

0 commit comments

Comments
 (0)