summaryrefslogtreecommitdiffstatshomepage
path: root/core/lib/Drupal/Core/Routing/EnhancerInterface.php
blob: 3439a4a17201aaea9ea695189e2ef691a03fb1b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

namespace Drupal\Core\Routing;

use Symfony\Component\HttpFoundation\Request;

/**
 * A route enhance service to determine route enhance rules.
 */
interface EnhancerInterface {

  /**
   * Updates the defaults for a route definition based on the request.
   *
   * @param array $defaults
   *   The defaults, maps to '_defaults' in the route definition YAML.
   * @param \Symfony\Component\HttpFoundation\Request $request
   *   The Request instance.
   *
   * @return array
   *   The modified defaults. Each enhancer MUST return the
   *   $defaults but may add or remove values.
   */
  public function enhance(array $defaults, Request $request);

}