1 | <?php |
||
16 | class Link implements \JsonSerializable |
||
17 | { |
||
18 | private $rel; |
||
19 | private $type; |
||
20 | private $href; |
||
21 | private $titles; |
||
22 | private $properties; |
||
23 | |||
24 | /** |
||
25 | * @param string[] $titles |
||
26 | * @param mixed[] $properties |
||
27 | */ |
||
28 | public function __construct(string $rel, ?string $type, ?string $href, array $titles, array $properties) |
||
36 | |||
37 | public function getRel(): string |
||
41 | |||
42 | public function getType(): ?string |
||
46 | |||
47 | public function getHref(): string |
||
51 | |||
52 | /** |
||
53 | * @return string[] |
||
54 | */ |
||
55 | public function getTitles(): array |
||
59 | |||
60 | public function addTitle(string $tag, string $title): void |
||
64 | |||
65 | /** |
||
66 | * @return string[] |
||
67 | */ |
||
68 | public function getProperties(): array |
||
72 | |||
73 | public function addProperty(string $key, string $property): void |
||
77 | |||
78 | public function jsonSerialize() |
||
92 | } |
||
93 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.