matchCollection example

/** * {@inheritdoc} */
  public function matchRequest(Request $request): array {
    $collection = $this->getInitialRouteCollection($request);
    if ($collection->count() === 0) {
      throw new ResourceNotFoundException(sprintf('No routes found for "%s".', $this->currentPath->getPath()));
    }
    $collection = $this->applyRouteFilters($collection$request);
    $collection = $this->applyFitOrder($collection);

    $ret = $this->matchCollection(rawurldecode($this->currentPath->getPath($request))$collection);
    return $this->applyRouteEnhancers($ret$request);
  }

  /** * {@inheritdoc} */
  protected function matchCollection($pathinfo, RouteCollection $routes): array {
    // Try a case-sensitive match.     $match = $this->doMatchCollection($pathinfo$routes, TRUE);
    // Try a case-insensitive match.     if ($match === NULL && $routes->count() > 0) {
      


    public function getContext(): RequestContext
    {
        return $this->context;
    }

    public function match(string $pathinfo): array
    {
        $this->allow = $this->allowSchemes = [];

        if ($ret = $this->matchCollection(rawurldecode($pathinfo) ?: '/', $this->routes)) {
            return $ret;
        }

        if ('/' === $pathinfo && !$this->allow && !$this->allowSchemes) {
            throw new NoConfigurationException();
        }

        throw 0 < \count($this->allow) ? new MethodNotAllowedException(array_unique($this->allow)) : new ResourceNotFoundException(sprintf('No routes found for "%s".', $pathinfo));
    }

    public function matchRequest(Request $request): array
    {


    public function getContext(): RequestContext
    {
        return $this->context;
    }

    public function match(string $pathinfo): array
    {
        $this->allow = $this->allowSchemes = [];

        if ($ret = $this->matchCollection(rawurldecode($pathinfo) ?: '/', $this->routes)) {
            return $ret;
        }

        if ('/' === $pathinfo && !$this->allow && !$this->allowSchemes) {
            throw new NoConfigurationException();
        }

        throw 0 < \count($this->allow) ? new MethodNotAllowedException(array_unique($this->allow)) : new ResourceNotFoundException(sprintf('No routes found for "%s".', $pathinfo));
    }

    public function matchRequest(Request $request): array
    {
Home | Imprint | This part of the site doesn't use cookies.