1 | <?php |
||
14 | final class LinkHandler extends AbstractLinkHandler |
||
15 | { |
||
16 | private const ALLOWED_RELS = [ |
||
17 | OptionsInterface::MODE_PRELOAD, |
||
18 | OptionsInterface::MODE_PREFETCH, |
||
19 | OptionsInterface::MODE_DNS_PREFETCH, |
||
20 | OptionsInterface::MODE_PRECONNECT, |
||
21 | OptionsInterface::MODE_PRERENDER, |
||
22 | ]; |
||
23 | |||
24 | /** |
||
25 | * @var HeadLink |
||
26 | */ |
||
27 | private $headLink; |
||
28 | |||
29 | /** |
||
30 | * @var OptionsInterface |
||
31 | */ |
||
32 | private $options; |
||
33 | |||
34 | 9 | public function __construct(HeadLink $headLink, OptionsInterface $options) |
|
39 | |||
40 | 8 | public function __invoke(MvcEvent $event): void |
|
65 | |||
66 | /** |
||
67 | * Whether the link is valid to be injected in headers |
||
68 | * |
||
69 | * @param array $attributes |
||
70 | * |
||
71 | * @return bool |
||
72 | */ |
||
73 | 6 | private function canInjectLink(array $attributes): bool |
|
81 | } |
||
82 |