From 3f1e3c7b8dd8541910235313e6125107022e9895 Mon Sep 17 00:00:00 2001 From: Quentin Gabriele Date: Sun, 25 Aug 2024 16:45:42 +0200 Subject: [PATCH] remove make --- src/SeoManager.php | 14 -------------- src/helpers.php | 6 +++++- tests/Units/StandardTest.php | 2 +- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/SeoManager.php b/src/SeoManager.php index 1160a97..e516d43 100644 --- a/src/SeoManager.php +++ b/src/SeoManager.php @@ -2,7 +2,6 @@ namespace Elegantly\Seo; -use Elegantly\Seo\Concerns\HasSeo; use Elegantly\Seo\Contracts\Taggable; use Elegantly\Seo\OpenGraph\OpenGraph; use Elegantly\Seo\Schemas\Schema; @@ -40,19 +39,6 @@ public static function default(): self ); } - public static function make(null|HasSeo|SeoManager $value = null): SeoManager - { - if ($value instanceof SeoManager) { - return $value; - } - - if ($value instanceof HasSeo) { - return $value->getSeo(); - } - - return static::default(); - } - public function toTags(): SeoTags { $tags = new SeoTags; diff --git a/src/helpers.php b/src/helpers.php index cca4fd7..77688e4 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -10,6 +10,10 @@ function seo(null|HasSeo|SeoManager $value = null): SeoManager return \Elegantly\Seo\Facades\SeoManager::current(); } - return SeoManager::make($value); + if ($value instanceof HasSeo) { + return $value->getSeo(); + } + + return $value; } } diff --git a/tests/Units/StandardTest.php b/tests/Units/StandardTest.php index fe6feae..13683a3 100644 --- a/tests/Units/StandardTest.php +++ b/tests/Units/StandardTest.php @@ -8,7 +8,7 @@ title: 'Foo', canonical: 'https://example.com/standard', description: 'Bar', - keywords: ["foo", "bar"], + keywords: ['foo', 'bar'], alternates: [ new Alternate( hreflang: 'en',