1 | <?php declare(strict_types=1); |
||
27 | class Link implements LinkInterface |
||
28 | { |
||
29 | /** |
||
30 | * If link contains sub-URL value and URL prefix should be added. |
||
31 | * |
||
32 | * @var bool |
||
33 | */ |
||
34 | private $isSubUrl; |
||
35 | |||
36 | /** |
||
37 | * Get link’s URL value (full URL or sub-URL). |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | private $value; |
||
42 | |||
43 | /** |
||
44 | * If link has meta information. |
||
45 | * |
||
46 | * @var bool |
||
47 | */ |
||
48 | private $hasMeta; |
||
49 | |||
50 | /** |
||
51 | * @var mixed |
||
52 | */ |
||
53 | private $meta; |
||
54 | |||
55 | /** |
||
56 | * @param bool $isSubUrl |
||
57 | * @param string $value |
||
58 | * @param bool $hasMeta |
||
59 | * @param mixed $meta |
||
60 | */ |
||
61 | 71 | public function __construct(bool $isSubUrl, string $value, bool $hasMeta, $meta = null) |
|
68 | |||
69 | /** |
||
70 | * @inheritdoc |
||
71 | */ |
||
72 | 67 | public function canBeShownAsString(): bool |
|
76 | |||
77 | /** |
||
78 | * @inheritdoc |
||
79 | */ |
||
80 | 67 | public function getStringRepresentation(string $prefix): string |
|
86 | |||
87 | /** |
||
88 | * @inheritdoc |
||
89 | */ |
||
90 | 1 | public function getArrayRepresentation(string $prefix): array |
|
101 | |||
102 | /** |
||
103 | * @param string $prefix |
||
104 | * |
||
105 | * @return string |
||
106 | */ |
||
107 | 67 | protected function buildUrl(string $prefix): string |
|
111 | } |
||
112 |