diff --git a/src/SEOTools/Contracts/JsonLd.php b/src/SEOTools/Contracts/JsonLd.php index f729ee9..2213b0a 100644 --- a/src/SEOTools/Contracts/JsonLd.php +++ b/src/SEOTools/Contracts/JsonLd.php @@ -126,6 +126,11 @@ public function setUrl($url); */ public function addImage($image); + /** + * @return boolean + */ + public function hasImage(): bool; + /** * @param string|array $images * diff --git a/src/SEOTools/Contracts/JsonLdMulti.php b/src/SEOTools/Contracts/JsonLdMulti.php index e8bd0f6..210b531 100644 --- a/src/SEOTools/Contracts/JsonLdMulti.php +++ b/src/SEOTools/Contracts/JsonLdMulti.php @@ -141,6 +141,11 @@ public function setUrl($url); */ public function addImage($image); + /** + * @return boolean + */ + public function hasImage(): bool; + /** * @param string|array $images * diff --git a/src/SEOTools/Contracts/OpenGraph.php b/src/SEOTools/Contracts/OpenGraph.php index 4159b83..9e2dd90 100644 --- a/src/SEOTools/Contracts/OpenGraph.php +++ b/src/SEOTools/Contracts/OpenGraph.php @@ -103,6 +103,11 @@ public function removeProperty($key); */ public function addImage($url, $attributes = []); + /** + * @return boolean + */ + public function hasImage(): bool; + /** * Add images to properties. * diff --git a/src/SEOTools/Contracts/TwitterCards.php b/src/SEOTools/Contracts/TwitterCards.php index c4263a6..48b2360 100644 --- a/src/SEOTools/Contracts/TwitterCards.php +++ b/src/SEOTools/Contracts/TwitterCards.php @@ -106,6 +106,11 @@ public function setUrl($url); */ public function addImage($image); + /** + * @return boolean + */ + public function hasImage(): bool; + /** * @param string|array $images * diff --git a/src/SEOTools/JsonLd.php b/src/SEOTools/JsonLd.php index 0c1f14d..8231cb7 100644 --- a/src/SEOTools/JsonLd.php +++ b/src/SEOTools/JsonLd.php @@ -212,6 +212,14 @@ public function addImage($image) return $this; } + /** + * {@inheritdoc} + */ + public function hasImage(): bool + { + return count($this->images) > 0; + } + /** * {@inheritdoc} */ diff --git a/src/SEOTools/JsonLdMulti.php b/src/SEOTools/JsonLdMulti.php index bf9a7b7..1e961a6 100644 --- a/src/SEOTools/JsonLdMulti.php +++ b/src/SEOTools/JsonLdMulti.php @@ -176,6 +176,14 @@ public function addImage($image) return $this; } + /** + * {@inheritdoc} + */ + public function hasImage(): bool + { + return count($this->images) > 0; + } + /** * {@inheritdoc} */ diff --git a/src/SEOTools/OpenGraph.php b/src/SEOTools/OpenGraph.php index 5cc6673..0875a31 100644 --- a/src/SEOTools/OpenGraph.php +++ b/src/SEOTools/OpenGraph.php @@ -731,6 +731,14 @@ public function addImage($source = null, $attributes = []) return $this; } + /** + * {@inheritdoc} + */ + public function hasImage(): bool + { + return count($this->images) > 0; + } + /** * {@inheritdoc} */ diff --git a/src/SEOTools/TwitterCards.php b/src/SEOTools/TwitterCards.php index ee9d5c0..fafffd7 100644 --- a/src/SEOTools/TwitterCards.php +++ b/src/SEOTools/TwitterCards.php @@ -151,6 +151,14 @@ public function addImage($image) return $this; } + /** + * {@inheritdoc} + */ + public function hasImage(): bool + { + return count($this->images) > 0; + } + /** * {@inheritdoc} *