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:----x1SmCPG0QfpN04fQW2S3bjPs8rqgAIq1FA3E111/i/ojgPQShzKUSmmHpzlNXwh0kLR5IkAKK2FAeWUhaEqrYimEa5sDqbxA2ykl7gViWIwJjpFLoNP0/r2fO6DMGDmoDwQxzdIb4Lt0xqeyfOjd9mebzEqDzHo5x2w7a2zTpVqUxWWmvfUhWPutO90EPzJSHmwZUHnvuyFlU1ptV9FF6Czj226NQ2nUeOR3vSYjSLTq9nUwISMH29IQSDmGCHgfiz4rnBNvm6ZL7UmbRvYuVNPL22oIUr8vZpCgB0TlR5WCx96VNc/94iEPG8Xb+reg7JhIbwhqiy/004H5QvjjBJT1YEcj+2WTWEBUhT46mI25j0kB2Xd9IovY0jXEHH81GE1RxEnUIRq1reODgchMYbQdMDEZu47xqp+7vzWGSEqu97w3Jyt4/Ieesg7eTy1+40AHlKEI1S06iwmUfW+oeMIOblnm1oF6fAe1+W1Qg+Ua9sWms2Pjb91B5tg4Vn4yms35uZAi8Bezkr+XbM0odT9HuY8OKSbeuMQaB0fQZpFdvg0ZhZ343h8exivg/dPwMlJWv6loA6prNn+vKS/WWrRxT/Iwl+XUfksQ2pm4DKQhLIFBX2ZsfagbrobPqs2Fi8lNiDnQKxLFvA48v54aTYbagdOuDI7r6lXuMS9oZ44=----ATTACHMENT:----OTk5MjY0NzkxNzMzNzAzMyAxOTY4NjUzMzAzNzEzNTQ0IDUwOTAxMzQzNDAyMTUwODE=