Skip to content

Commit

Permalink
=
Browse files Browse the repository at this point in the history
  • Loading branch information
arikaim-repository committed Jun 25, 2021
1 parent 4482dbc commit 2073849
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
4 changes: 1 addition & 3 deletions Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ public static function validate(string $method, string $pattern, $routes)
return true;
};

$result = $callback($collector);

return $result;
return $callback($collector);
}

/**
Expand Down
11 changes: 2 additions & 9 deletions Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
*/
class Routes implements RoutesInterface
{
/**
* Cache save time
*
* @var integer
*/
public static $cacheSaveTime = 4;

/**
* Routes storage adapter
*
Expand Down Expand Up @@ -430,7 +423,7 @@ public function getAllRoutes()
$routes = $this->cache->fetch('routes.list');
if ($routes === false) {
$routes = $this->getRoutes(['status' => 1]);
$this->cache->save('routes.list',$routes,Self::$cacheSaveTime);
$this->cache->save('routes.list',$routes);
}

return $routes;
Expand All @@ -449,7 +442,7 @@ public function searchRoutes(string $method, $type = null): array
$routes = $this->cache->fetch($cacheItemkey);
if ($routes === false) {
$routes = $this->adapter->searchRoutes($method,$type);
$this->cache->save($cacheItemkey,$routes,Self::$cacheSaveTime);
$this->cache->save($cacheItemkey,$routes);
}

return $routes;
Expand Down

0 comments on commit 2073849

Please sign in to comment.