Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ignaszak committed Mar 23, 2016
1 parent d1926d9 commit 0ced1ac
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions src/Parser/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,24 @@ public function run(
$query,
$m,
PREG_OFFSET_CAPTURE
)
) &&
$this->httpMethod($route['method'] ?? '', $httpMethod)
) {

if ($this->httpMethod($route['method'] ?? '', $httpMethod)) {
$controller = $route['controller'] ?? '';
$attachment = $route['attachment'] ?? '';
$callAttachment = $route['callAttachment'] ?? false;
$routes = $this->formatArray($m);

$request = [
'name' => $name,
'controller' => $controller,
'callAttachment' => $callAttachment,
'attachment' => $attachment,
'params' => $routes,
'group' => $route['group']
];

$this->callAttachment($request);
return $request;
}

$controller = $route['controller'] ?? '';
$routes = $this->formatArray($m);
$request = [
'name' => $name,
'controller' => $this->matchController(
$controller,
$routes
),
'callAttachment' => $route['callAttachment'] ?? false,
'attachment' => $route['attachment'] ?? '',
'params' => $routes,
'group' => $route['group']
];
$this->callAttachment($request);
return $request;
}
}
return [];
Expand Down

0 comments on commit 0ced1ac

Please sign in to comment.