Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicollassilva committed Jun 10, 2021
1 parent 5eb5e7d commit fcf2008
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@ protected function resolveHeaders()
* Method responsible for returning the
* current route in parts.
*
* @return array|string|null
* @return string|null|array
*/
protected function getParsedRoute(?String $data = null)
{
$parsedRoute = parse_url($this->fullUrl ?? "/");

if (empty($data)) {
return $parsedRoute;
}
if (empty($data)) return $parsedRoute;

if (isset($parsedRoute[$data])) {
return $parsedRoute[$data];
Expand All @@ -84,7 +82,7 @@ protected function getParsedRoute(?String $data = null)
* Method responsible for returning
* the current route path.
*
* @return string|array
* @return string
*/
public function path()
{
Expand Down Expand Up @@ -190,7 +188,7 @@ public function __get(String $data)
*/
protected function resolveRouteData(String $route, array $routeParams): void
{
$params = $this->path();
$params = (string) $this->path();

$diff = array_diff(explode('/', $params), explode('/', $route));

Expand Down
6 changes: 5 additions & 1 deletion src/Router/Middlewares/MiddlewareCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ public function execute()
*/
protected function executeMiddleware()
{
$middlewares = explode(',', $this->middlewares);
$middlewares = $this->middlewares;

if(is_string($middlewares)) {
$middlewares = explode(',', $middlewares);
}

$this->resolveNestedMiddleware($middlewares);

Expand Down
2 changes: 1 addition & 1 deletion src/Router/RouteManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ protected function setName(String $value)
/**
* Get the route default name.
*
* @return void
* @return string|null
*/
protected function getDefaultName()
{
Expand Down

0 comments on commit fcf2008

Please sign in to comment.