FilterInterface.php

Namespace

Drupal\Core\Routing

File

core/lib/Drupal/Core/Routing/FilterInterface.php

View source
<?php

namespace Drupal\Core\Routing;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\RouteCollection;

/**
 * A route filter service to filter down the collection of route instances.
 */
interface FilterInterface {
  
  /**
   * Filters the route collection against a request.
   *
   * @param \Symfony\Component\Routing\RouteCollection $collection
   *   The collection against which to match.
   * @param \Symfony\Component\HttpFoundation\Request $request
   *   A Request object against which to match.
   *
   * @return \Symfony\Component\Routing\RouteCollection
   *   A non-empty RouteCollection of matched routes
   *
   * @throws \Symfony\Component\Routing\Exception\ResourceNotFoundException
   *   If none of the routes in $collection matches $request. This is a
   *   performance optimization to not continue the match process when a match
   *   will no longer be possible.
   */
  public function filter(RouteCollection $collection, Request $request);

}

Interfaces

Title Deprecated Summary
FilterInterface A route filter service to filter down the collection of route instances.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.