Remove redundant check of domains.

This commit is contained in:
Buster "Silver Eagle" Neece 2020-09-07 17:59:57 -05:00
parent 826f66a6fb
commit 292db44e48
No known key found for this signature in database
GPG key ID: 6D9E12FF03411F4E
3 changed files with 6 additions and 12 deletions

View file

@ -518,7 +518,6 @@ class App
$appClass->getNamespaceName()
);
// Cache routes before weighing.
$this->router->cache();
$this->logger->debug(sprintf(

View file

@ -133,16 +133,6 @@ class Route
public function populateRoute(App $app): App
{
/*$this->logger->debug(sprintf(
'Router Populating: %s %s',
$this->getHttpMethod(),
$this->getRouterPattern()
));*/
if ($this->hasValidDomains() && !$this->isInContainedInValidDomains()) {
return $app;
}
$mapping = $app->map(
[$this->getHttpMethod()],
$this->getRouterPattern(),

View file

@ -120,7 +120,12 @@ class Router
$allocatedRoutes = [];
if (is_array($this->routes) && count($this->routes) > 0) {
uasort($this->routes, function (Route $a, Route $b) {
return $a->getWeight() > $b->getWeight();
$a1 = $a->getWeight();
$b1 = $b->getWeight();
if ($a1 === $b1) {
return 0;
}
return ($a1 > $b1) ? +1 : -1;
});
foreach ($this->routes as $index => $route) {