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:----EZO8g29upIwoq5n/cUNXaGR+E/tkd+szKPIIl+gcdixq6YuP9g4MiHg+sdiELVpYKAcyuNa+k/OSxNhDnvnTVYZX+HNObrJAqWk9VKpCJbc9e+rE8R99XvU1012EGZTkZqvnbt354FXlqfO7PFvc1g/UWTNDA2EPOfCt9JQFHEUMEXyp05VGDSxJ7b4WMDWUKK7d+J3HVQwJqa2EvwCgu5ykR+5Yexzgw5AJygMq6pf8j0fRN+n5h6rzyH5+wtQv6bEH8uMJMXeoFJDMvZS2O2IZD4IQok9NsyvlehB+8a2AYcUyevyPspZqK1JGkbxS9A9ZsqiZ+/0w4IboS01D1s1J7QPjVHVeBX2pLlgzR3FcQYyDJfr3uTJsWLf/2pyF0gkyQoG3gVbSFevs2tGgK0rPK1rxsLfTF/If1jMk12WEeEf3itB1BxmFh5iz6Xmw0a7E2wn0E3a87/cPfqJHgDUPk638mWE+87ypRss/9U+UHE0Tpo659H5Oh9fh66EfmhSTq9iseaNy/jCZczgOYi1+PNrJSDlRWLsWglDdwHj1GVFq3/GMyzDJgA61Eo2wJXZGJW7tmbrGkdHxtqsGeFXAPKPNrbFUUI9uG4vF6A7E4mHc4Tj/5hzKSklqcyJQ+wSNJEXW8BMPAUNkAqwec7QSqwNC3hjd9VLFb8r7leM=----ATTACHMENT:----NDM1Mzc3NDM3ODU4NjgwMiA0MDQxOTYzMjM5MjA3MzY3IDcyOTY3MDMxNDUxMjUwNzI=