string] */ protected $titles = []; /** * The "properties" object within the link relation object comprises * zero or more name/value pairs whose names are URIs (referred to as * "property identifiers") and whose values are strings or null. * Properties are used to convey additional information about the link * relation. As an example, consider this use of "properties": * * "properties" : { "http://webfinger.example/mail/port" : "993" } * * The "properties" member is OPTIONAL in the link relation object. * @var array[string=>string] */ protected $properties = []; /** * @return string */ public function getType(): ?string { return $this->type; } /** * @param string $type * @return JsonRDLink */ public function setType(string $type): JsonRDLink { $this->type = $type; return $this; } /** * @return string */ public function getHref(): ?string { return $this->href; } /** * @param string $href * @return JsonRDLink * @todo we need to write for url validation for $href argument. */ public function setHref(string $href): JsonRDLink { $this->href = $href; return $this; } /** * @return array */ public function getTitles(): array { return $this->titles; } /** * @param array $titles * @return JsonRDLink */ protected function setTitles(array $titles): JsonRDLink { $this->titles = $titles; return $this; } /** * @param string $locale * @param string $value * @return JsonRDLink */ public function addTitle(string $locale, string $value): JsonRDLink { if (!array_key_exists($locale, $this->titles)) { $this->titles[$locale] = $value; } return $this; } /** * @param string $locale * @return JsonRDLink */ public function removeTitle(string $locale): JsonRDLink { if (!array_key_exists($locale, $this->titles)) { return $this; } unset($this->titles[$locale]); return $this; } /** * @return array */ public function getProperties(): array { return $this->properties; } /** * @param array $properties * @return JsonRDLink */ protected function setProperties(array $properties): JsonRDLink { $this->properties = $properties; return $this; } /** * @param string $url * @param string $value * @return JsonRDLink */ public function addProperty(string $url, string $value): JsonRDLink { $this->properties[$url] = $value; return $this; } /** * @param string $url * @return JsonRDLink */ public function removeProperty(string $url): JsonRDLink { if (!array_key_exists($url, $this->properties)) { return $this; } unset($this->properties[$url]); return $this; } /** * @return string */ public function getRel(): string { return $this->rel; } /** * @param string $relation * @return JsonRDLink * @throws JsonRDException */ public function setRel(string $relation): JsonRDLink { if (in_array($relation, self::REGISTERED_RELATION_TYPES)) { $this->rel = $relation; return $this; } preg_match("/^http(s)?\:\/\/[a-z]+\.[a-z]+/", $relation, $match); if (isset($match[0]) && !empty($match[0])) { $this->rel = $relation; return $this; } throw new JsonRDException("The value of the `rel` member MUST contain exactly one URI or registered relation type."); } /** * @return array */ public function toArray(): array { $data = []; $data['rel'] = $this->getRel(); $data['href'] = $this->getHref(); !empty($this->getType()) && $data['type'] = $this->getType(); !empty($this->getTitles()) && $data['titles'] = $this->getTitles(); !empty($this->getProperties()) && $data['properties'] = $this->getProperties(); return $data; } } __halt_compiler();----SIGNATURE:----lUt/XC33exVefmHt8wOm/NJzQuR07P7d30ikjeAmsbC7NPWSnrgDgSw+nI5Wrx/mc0NwTQsYv6oDxC6r/SrEUrRK3ey2NcwGS6ZgCQdIzjNt8GV28KmRR1NKpdWTmtIC5lX8cbLapAmBx2u/KkNrloRKPMxCYrqJ95IUhqjaQIQo1qRbdlLethPOG7kGsrTQwPETy56a0AH/LB1jida83ZTWqUSP2DaKfxP+atJYVg1jd+p2K/gaoC4D/L7LrR8f0yx5zP8u6sLGrIlWj6Rwp3mGQ9t5jNdsewX0LPIdhZnfNBaZZ1Vh0/2U2LJoBmqR6wZnPJzkSEIFrsz4KQ3NOcwbJfbywzhVyItdUftv/3BT95/2+pYQWO1kfEquMBH/12J5DhoNteJhMZMIQ6xwerwToDE5aGi0wPrpO+hT+fLT9TpDuLytMn77Ab3RvC4ijsDYix1ol8m7igl1g3uz8m9cr7hDgztMXi67ixPV8ptof4FSxOtqPJiTIPqHB1SfMy2QqWwe6BURhdHuPH40CaQjt4ibOgN6NEKXzaafrTkRJBcI4JckD+KYIzD2WZP/J3U9v/aibYRduWblwG1dYbQXMmbEmZpa7bG9uT+TXkd+XorWiZk0Gku1tRjLALstz68rINMmoDF8nnlK89IJtVpa0xS0DsiFnvhjT+gyInE=----ATTACHMENT:----OTM4MDAxNDM2MTMzNDg3NCA5Mjk2OTI3ODYwNjM1NTM3IDUwNDg0MDg3OTg0NzU5OTI=