Skip to content

Commit

Permalink
Add hasImage method
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-alrek committed Jun 16, 2021
1 parent 9ba42a4 commit 2b37712
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/SEOTools/Contracts/JsonLd.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ public function setUrl($url);
*/
public function addImage($image);

/**
* @return boolean
*/
public function hasImage(): bool;

/**
* @param string|array $images
*
Expand Down
5 changes: 5 additions & 0 deletions src/SEOTools/Contracts/JsonLdMulti.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ public function setUrl($url);
*/
public function addImage($image);

/**
* @return boolean
*/
public function hasImage(): bool;

/**
* @param string|array $images
*
Expand Down
5 changes: 5 additions & 0 deletions src/SEOTools/Contracts/OpenGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ public function removeProperty($key);
*/
public function addImage($url, $attributes = []);

/**
* @return boolean
*/
public function hasImage(): bool;

/**
* Add images to properties.
*
Expand Down
5 changes: 5 additions & 0 deletions src/SEOTools/Contracts/TwitterCards.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ public function setUrl($url);
*/
public function addImage($image);

/**
* @return boolean
*/
public function hasImage(): bool;

/**
* @param string|array $images
*
Expand Down
8 changes: 8 additions & 0 deletions src/SEOTools/JsonLd.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ public function addImage($image)
return $this;
}

/**
* {@inheritdoc}
*/
public function hasImage(): bool
{
return count($this->images) > 0;
}

/**
* {@inheritdoc}
*/
Expand Down
8 changes: 8 additions & 0 deletions src/SEOTools/JsonLdMulti.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ public function addImage($image)
return $this;
}

/**
* {@inheritdoc}
*/
public function hasImage(): bool
{
return count($this->images) > 0;
}

/**
* {@inheritdoc}
*/
Expand Down
8 changes: 8 additions & 0 deletions src/SEOTools/OpenGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,14 @@ public function addImage($source = null, $attributes = [])
return $this;
}

/**
* {@inheritdoc}
*/
public function hasImage(): bool
{
return count($this->images) > 0;
}

/**
* {@inheritdoc}
*/
Expand Down
8 changes: 8 additions & 0 deletions src/SEOTools/TwitterCards.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ public function addImage($image)
return $this;
}

/**
* {@inheritdoc}
*/
public function hasImage(): bool
{
return count($this->images) > 0;
}

/**
* {@inheritdoc}
*
Expand Down

0 comments on commit 2b37712

Please sign in to comment.