1 | <?php |
||
15 | final class LinkHandler extends AbstractLinkHandler |
||
16 | { |
||
17 | const ALLOWED_RELS = [ |
||
18 | OptionsInterface::MODE_PRELOAD, |
||
19 | OptionsInterface::MODE_PREFETCH, |
||
20 | OptionsInterface::MODE_DNS_PREFETCH, |
||
21 | OptionsInterface::MODE_PRECONNECT, |
||
22 | OptionsInterface::MODE_PRERENDER, |
||
23 | ]; |
||
24 | |||
25 | /** |
||
26 | * @var HeadLink |
||
27 | */ |
||
28 | private $headLink; |
||
29 | |||
30 | /** |
||
31 | * @var OptionsInterface |
||
32 | */ |
||
33 | private $options; |
||
34 | |||
35 | /** |
||
36 | * LinkHandler constructor. |
||
37 | * |
||
38 | * @param HeadLink $headLink |
||
39 | * @param OptionsInterface $options |
||
40 | */ |
||
41 | 9 | public function __construct(HeadLink $headLink, OptionsInterface $options) |
|
46 | |||
47 | /** |
||
48 | * @param MvcEvent $event |
||
49 | */ |
||
50 | 8 | public function __invoke(MvcEvent $event) |
|
75 | |||
76 | /** |
||
77 | * Whether the link is valid to be injected in headers |
||
78 | * |
||
79 | * @param array $attributes |
||
80 | * @return bool |
||
81 | */ |
||
82 | 6 | private function canInjectLink(array $attributes): bool |
|
90 | } |
||
91 |