keywords)) { $this->keywords[] = $keyword; } } /** * Get keywords. * * @return string[] Keywords * * @since 1.0.0 */ public function getKeywords() : array { return $this->keywords; } /** * Get author. * * @return string Author * * @since 1.0.0 */ public function getAuthor() : string { return $this->author; } /** * Set author. * * @param string $author Author * * @return void * * @since 1.0.0 */ public function setAuthor(string $author) : void { $this->author = $author; } /** * Get charset. * * @return string Charset * * @since 1.0.0 */ public function getCharset() : string { return $this->charset; } /** * Set charset. * * @param string $charset Charset * * @return void * * @since 1.0.0 */ public function setCharset(string $charset) : void { $this->charset = $charset; } /** * Get description. * * @return string Descritpion * * @since 1.0.0 */ public function getDescription() : string { return $this->description; } /** * Set description. * * @param string $description Meta description * * @return void * * @since 1.0.0 */ public function setDescription(string $description) : void { $this->description = $description; } /** * Set property. * * @param string $property Property * @param string $content Content * * @return void * * @since 1.0.0 */ public function setProperty(string $property, string $content) : void { $this->properties[$property] = $content; } /** * Set itemprop. * * @param string $itemprop Property * @param string $content Content * * @return void * * @since 1.0.0 */ public function setItemprop(string $itemprop, string $content) : void { $this->itemprops[$itemprop] = $content; } /** * Set name. * * @param string $name Property * @param string $content Content * * @return void * * @since 1.0.0 */ public function setName(string $name, string $content) : void { $this->names[$name] = $content; } /** * {@inheritdoc} */ public function render() : string { return (count($this->keywords) > 0 ? '"' : '') . (!empty($this->author) ? '' : '') . (!empty($this->description) ? '' : '') . (!empty($this->charset) ? '' : '') . '' . $this->renderProperty() . $this->renderItemprop() . $this->renderName(); } /** * Render property meta tags. * * @return string * * @since 1.0.0 */ private function renderProperty() : string { $properties = ''; foreach ($this->properties as $key => $content) { $properties .= ''; } return $properties; } /** * Render itemprop meta tags. * * @return string * * @since 1.0.0 */ private function renderItemprop() : string { $itemprops = ''; foreach ($this->itemprops as $key => $content) { $itemprops .= ''; } return $itemprops; } /** * Render name meta tags. * * @return string * * @since 1.0.0 */ private function renderName() : string { $names = ''; foreach ($this->names as $key => $content) { $names .= ''; } return $names; } }