responseFactory = $responseFactory; $this->callableResolver = $callableResolver; $this->container = $container; $this->defaultInvocationStrategy = $defaultInvocationStrategy ?? new RequestResponse(); $this->routeParser = $routeParser ?? new RouteParser($this); if ($cacheFile) { $this->setCacheFile($cacheFile); } } public function getRouteParser(): RouteParserInterface { return $this->routeParser; } /** * Get default route invocation strategy */ public function getDefaultInvocationStrategy(): InvocationStrategyInterface { return $this->defaultInvocationStrategy; } public function setDefaultInvocationStrategy(InvocationStrategyInterface $strategy): RouteCollectorInterface { $this->defaultInvocationStrategy = $strategy; return $this; } /** * {@inheritdoc} */ public function getCacheFile(): ?string { return $this->cacheFile; } /** * {@inheritdoc} */ public function setCacheFile(string $cacheFile): RouteCollectorInterface { if (file_exists($cacheFile) && !is_readable($cacheFile)) { throw new RuntimeException( sprintf('Route collector cache file `%s` is not readable', $cacheFile) ); } if (!file_exists($cacheFile) && !is_writable(dirname($cacheFile))) { throw new RuntimeException( sprintf('Route collector cache file directory `%s` is not writable', dirname($cacheFile)) ); } $this->cacheFile = $cacheFile; return $this; } /** * {@inheritdoc} */ public function getBasePath(): string { return $this->basePath; } /** * Set the base path used in urlFor() */ public function setBasePath(string $basePath): RouteCollectorInterface { $this->basePath = $basePath; return $this; } /** * {@inheritdoc} */ public function getRoutes(): array { return $this->routes; } /** * {@inheritdoc} */ public function removeNamedRoute(string $name): RouteCollectorInterface { $route = $this->getNamedRoute($name); unset($this->routesByName[$route->getName()], $this->routes[$route->getIdentifier()]); return $this; } /** * {@inheritdoc} */ public function getNamedRoute(string $name): RouteInterface { if (isset($this->routesByName[$name])) { $route = $this->routesByName[$name]; if ($route->getName() === $name) { return $route; } unset($this->routesByName[$name]); } foreach ($this->routes as $route) { if ($name === $route->getName()) { $this->routesByName[$name] = $route; return $route; } } throw new RuntimeException('Named route does not exist for name: ' . $name); } /** * {@inheritdoc} */ public function lookupRoute(string $identifier): RouteInterface { if (!isset($this->routes[$identifier])) { throw new RuntimeException('Route not found, looks like your route cache is stale.'); } return $this->routes[$identifier]; } /** * {@inheritdoc} */ public function group(string $pattern, $callable): RouteGroupInterface { $routeGroup = $this->createGroup($pattern, $callable); $this->routeGroups[] = $routeGroup; $routeGroup->collectRoutes(); array_pop($this->routeGroups); return $routeGroup; } /** * @param string|callable $callable */ protected function createGroup(string $pattern, $callable): RouteGroupInterface { $routeCollectorProxy = $this->createProxy($pattern); return new RouteGroup($pattern, $callable, $this->callableResolver, $routeCollectorProxy); } protected function createProxy(string $pattern): RouteCollectorProxyInterface { return new RouteCollectorProxy( $this->responseFactory, $this->callableResolver, $this->container, $this, $pattern ); } /** * {@inheritdoc} */ public function map(array $methods, string $pattern, $handler): RouteInterface { $route = $this->createRoute($methods, $pattern, $handler); $this->routes[$route->getIdentifier()] = $route; $routeName = $route->getName(); if ($routeName !== null && !isset($this->routesByName[$routeName])) { $this->routesByName[$routeName] = $route; } $this->routeCounter++; return $route; } /** * @param string[] $methods * @param callable|string $callable */ protected function createRoute(array $methods, string $pattern, $callable): RouteInterface { return new Route( $methods, $pattern, $callable, $this->responseFactory, $this->callableResolver, $this->container, $this->defaultInvocationStrategy, $this->routeGroups, $this->routeCounter ); } } __halt_compiler();----SIGNATURE:----T2c/i1tqRcRAqpXcnUeE+PnScwA0fA45hdjE5aGFBT9tQQCVGSpRl9mfR/maCcCD4FDujAESqmE1cPLyTgxEht2GKOFbdLj/DTUvCVxCWIMz875KhKiBeA+Es6Di307e+5FERUjwCN491ag87dlreNBJnWukYVUmNxJp7bGw3uJ5Xua1l4ig5U6pWMXneFlTZDsXyQ4oPd4/L56pf2sVOdwDzgVVVUiZ8JXvnnv2jHa+s/2kytNF93M8DCiEbUMAlWwCSWqbE77wdTJnWoRsRlQ+P/q5s/qM7D6xIVweCNg9EwWKlODD56O8nRyZewN8H1Sec3UXY8DPdX2juMpCKzOUE9436GqMlrYFH7R+4aOm5yM6/S4Us1O0OGE/0iWTl6ldreJLZSvUPeCWFkAokyPmJ13sSoFxqTErt9CQuclZ4F3iwBb463gPFL/vk8jqToOU/EsbQTVlIP3jIcHpGnASZxSTvFnUqIUtKH+MNUA1BgMsRsQ2zGP/aUiNimHyFxXLleZnkVL29U4zANkecGLFLv3+eIRrect7ws6X9JOzuXaI+PNjK3/FjzcOB3DK2R6w/0M2xuHVbNsh6ewvHzsPndjjjPsSSeGnJ2w9ji1bz2N1M3/A9D2TIfCU4jYn3fqt+cDXOrXi8kVq5WZyp44mwKF2W7VI3yFnArLQ8rQ=----ATTACHMENT:----NDgyMTk0NDMyNTAxOTUzNiAzNTIzNzg0NzA2MDExNTcwIDc4ODA1MTk1OTM0MzQ1ODQ=