1 | <?php |
||
13 | abstract class AbstractCompiler implements DestinationCompiler |
||
14 | { |
||
15 | /** @var ContextExtractor */ |
||
16 | private $extractor; |
||
17 | /** @var \Twig_Environment */ |
||
18 | private $twig; |
||
19 | /** @var DestinationNormalizer */ |
||
20 | private $normalizer; |
||
21 | |||
22 | /** |
||
23 | * AbstractCompiler constructor. |
||
24 | * |
||
25 | * @param DestinationNormalizer $normalizer |
||
26 | * @param \Twig_Environment $twig |
||
27 | */ |
||
28 | 1 | public function __construct(DestinationNormalizer $normalizer, \Twig_Environment $twig = null) |
|
34 | |||
35 | /** {@inheritdoc} */ |
||
36 | 1 | final public function compile(DestinationInterface $destination, $title = null, array $attributes = []) |
|
55 | |||
56 | /** |
||
57 | * Allows replace twig via DI |
||
58 | * |
||
59 | * @param \Twig_Environment $twig |
||
60 | */ |
||
61 | public function setTwig(\Twig_Environment $twig) |
||
65 | |||
66 | /** |
||
67 | * @param string $route |
||
68 | * |
||
69 | * @return CompilableLinkInterface |
||
70 | */ |
||
71 | abstract protected function getHrefTemplate($route); |
||
72 | |||
73 | 1 | private function normalize($item) |
|
81 | } |
||
82 |