/home/techb158/immovalet.com/vendor/laravel/framework/src/Illuminate/Routing
NameSizeModeActions
Console/-0755rm
Contracts/-0755rm
Events/-0755rm
Exceptions/-0755rm
Matching/-0755rm
Middleware/-0755rm
AbstractRouteCollection.php78260644editdlrm
CompiledRouteCollection.php90860644editdlrm
composer.json14710644editdlrm
Controller.php16600644editdlrm
ControllerDispatcher.php23090644editdlrm
ControllerMiddlewareOptions.php10130644editdlrm
CreatesRegularExpressionRouteConstraints.php18330644editdlrm
ImplicitRouteBinding.php23850644editdlrm
LICENSE.md10750644editdlrm
MiddlewareNameResolver.php31780644editdlrm
PendingResourceRegistration.php56310644editdlrm
Pipeline.php15030644editdlrm
RedirectController.php12080644editdlrm
Redirector.php73960644editdlrm
ResourceRegistrar.php149270644editdlrm
ResponseFactory.php77690644editdlrm
Route.php279680644editdlrm
RouteAction.php33130644editdlrm
RouteBinding.php27500644editdlrm
RouteCollection.php70510644editdlrm
RouteCollectionInterface.php23320644editdlrm
RouteDependencyResolverTrait.php34700644editdlrm
RouteFileRegistrar.php6410644editdlrm
RouteGroup.php26640644editdlrm
RouteParameterBinder.php31180644editdlrm
Router.php355360644editdlrm
RouteRegistrar.php66050644editdlrm
RouteSignatureParameters.php14570644editdlrm
RouteUri.php13300644editdlrm
RouteUrlGenerator.php92960644editdlrm
RoutingServiceProvider.php60840644editdlrm
SortedMiddleware.php36640644editdlrm
UrlGenerator.php198880644editdlrm
ViewController.php8690644editdlrm
Edit: /home/techb158/immovalet.com/vendor/laravel/framework/src/Illuminate/Routing/SortedMiddleware.php (3664B)
all(); } $this->items = $this->sortMiddleware($priorityMap, $middlewares); } /** * Sort the middlewares by the given priority map. * * Each call to this method makes one discrete middleware movement if necessary. * * @param array $priorityMap * @param array $middlewares * @return array */ protected function sortMiddleware($priorityMap, $middlewares) { $lastIndex = 0; foreach ($middlewares as $index => $middleware) { if (! is_string($middleware)) { continue; } $priorityIndex = $this->priorityMapIndex($priorityMap, $middleware); if (! is_null($priorityIndex)) { // This middleware is in the priority map. If we have encountered another middleware // that was also in the priority map and was at a lower priority than the current // middleware, we will move this middleware to be above the previous encounter. if (isset($lastPriorityIndex) && $priorityIndex < $lastPriorityIndex) { return $this->sortMiddleware( $priorityMap, array_values($this->moveMiddleware($middlewares, $index, $lastIndex)) ); } // This middleware is in the priority map; but, this is the first middleware we have // encountered from the map thus far. We'll save its current index plus its index // from the priority map so we can compare against them on the next iterations. $lastIndex = $index; $lastPriorityIndex = $priorityIndex; } } return Router::uniqueMiddleware($middlewares); } /** * Calculate the priority map index of the middleware. * * @param array $priorityMap * @param string $middleware * @return int|null */ protected function priorityMapIndex($priorityMap, $middleware) { foreach ($this->middlewareNames($middleware) as $name) { $priorityIndex = array_search($name, $priorityMap); if ($priorityIndex !== false) { return $priorityIndex; } } } /** * Resolve the middleware names to look for in the priority array. * * @param string $middleware * @return \Generator */ protected function middlewareNames($middleware) { $stripped = head(explode(':', $middleware)); yield $stripped; $interfaces = @class_implements($stripped); if ($interfaces !== false) { foreach ($interfaces as $interface) { yield $interface; } } } /** * Splice a middleware into a new position and remove the old entry. * * @param array $middlewares * @param int $from * @param int $to * @return array */ protected function moveMiddleware($middlewares, $from, $to) { array_splice($middlewares, $to, 0, $middlewares[$from]); unset($middlewares[$from + 1]); return $middlewares; } }