CompiledRoute.php 1.06 KB
Newer Older
Crell's avatar
Crell committed
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php

namespace Drupal\Core\Routing;

use Symfony\Component\Routing\CompiledRoute as SymfonyCompiledRoute;
use Symfony\Component\Routing\Route;

/**
 * Description of CompiledRoute
 */
class CompiledRoute extends SymfonyCompiledRoute {

  /**
   * The fitness of this route.
   *
   * @var int
   */
  protected $fit;

  /**
    * Constructor.
    *
    * @param Route  $route
    *   A original Route instance.
    * @param int $fit
    *   The fitness of the route.
    * @param string $regex        The regular expression to use to match this route
    * @param array  $tokens       An array of tokens to use to generate URL for this route
    * @param array  $variables    An array of variables
    */
  public function __construct(Route $route, $fit) {
    // We're ignoring the rest of this stuff; really this should be just using
    // an interface, but the Symfony component doesn't have one. This is a bug
    // in Symfony.
    parent::__construct($route, '', '', array(), array());

    $this->fit = $fit;
  }

  public function getFit() {
    return $this->fit;
  }

}