Skip to content

Commit

Permalink
addSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Sep 13, 2024
1 parent 2dcc5ef commit dbfbdcd
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions src/SeoManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function current(): static
}

/**
* @param null|Standard|(Closure(Standard):null|Standard) $value
* @param null|Standard|(Closure(Standard):(null|Standard)) $value
* @return $this
*/
public function setStandard(null|Standard|Closure $value): static
Expand All @@ -57,7 +57,7 @@ public function setStandard(null|Standard|Closure $value): static
}

/**
* @param null|OpenGraph|(Closure(OpenGraph):null|OpenGraph) $value
* @param null|OpenGraph|(Closure(OpenGraph):(null|OpenGraph)) $value
* @return $this
*/
public function setOpengraph(null|OpenGraph|Closure $value): static
Expand All @@ -72,7 +72,7 @@ public function setOpengraph(null|OpenGraph|Closure $value): static
}

/**
* @param null|Card|(Closure(Card):null|Card) $value
* @param null|Card|(Closure(Card):(null|Card)) $value
* @return $this
*/
public function setTwitter(null|Card|Closure $value): static
Expand All @@ -87,7 +87,7 @@ public function setTwitter(null|Card|Closure $value): static
}

/**
* @param null|WebPage|(Closure(WebPage):null|WebPage) $value
* @param null|WebPage|(Closure(WebPage):(null|WebPage)) $value
* @return $this
*/
public function setWebpage(null|WebPage|Closure $value): static
Expand All @@ -101,6 +101,33 @@ public function setWebpage(null|WebPage|Closure $value): static
return $this;
}

/**
* @param null|Schema[]|(Closure(Schema[]):(null|Schema[])) $value
* @return $this
*/
public function setSchemas(null|array|Closure $value): static
{
if ($value instanceof Closure) {
$this->schemas = $value($this->schemas ?? []);
} else {
$this->schemas = $value;
}

return $this;
}

/**
* @return $this
*/
public function addSchema(Schema $value): static
{
return $this->setSchemas(function ($schemas) use ($value) {
$schemas[] = $value;

return $schemas;
});
}

public function setTitle(string $value): static
{
if ($this->standard) {
Expand Down

0 comments on commit dbfbdcd

Please sign in to comment.