diff --git a/.gitattributes b/.gitattributes
index 7ccb1f3..22f739a 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -7,6 +7,5 @@
.gitattributes export-ignore
.gitignore export-ignore
.scrutinizer.yml export-ignore
-.travis.yml export-ignore
phpunit.xml.dist export-ignore
CONTRIBUTING.md export-ignore
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 3d5c231..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-language: php
-
-php:
- - 7.2
- - 7.3
- - nightly
-
-matrix:
- allow_failures:
- - php: nightly
-
-before_script:
- - travis_retry composer self-update
- - travis_retry composer install --prefer-source --no-interaction --dev
-
-script:
- - composer validate
- - mkdir -p build/logs
- - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
-
-after_script:
- - if [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- - if [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
diff --git a/README.md b/README.md
index ca49ec5..d62cc39 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# SEO Helper [![Packagist License][badge_license]](LICENSE.md) [![For PHP][badge_php]][link-github-repo]
-[![Travis Status][badge_build]][link-travis]
+[![Github Workflow Status][badge_build]][link-github-status]
[![Coverage Status][badge_coverage]][link-scrutinizer]
[![Scrutinizer Code Quality][badge_quality]][link-scrutinizer]
[![SensioLabs Insight][badge_insight]][link-insight]
@@ -51,7 +51,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.
[badge_php]: https://img.shields.io/badge/PHP-Framework%20agnostic-4F5B93.svg?style=flat-square
[badge_license]: https://img.shields.io/packagist/l/arcanedev/seo-helper.svg?style=flat-square
-[badge_build]: https://img.shields.io/travis/ARCANEDEV/SEO-Helper.svg?style=flat-square
+[badge_build]: https://img.shields.io/github/workflow/status/ARCANEDEV/SEO-Helper/run-tests?style=flat-square
[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/SEO-Helper.svg?style=flat-square
[badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/SEO-Helper.svg?style=flat-square
[badge_insight]: https://img.shields.io/sensiolabs/i/73e1a779-7ca7-4a75-b6d3-452d7852187e.svg?style=flat-square
@@ -62,6 +62,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.
[link-author]: https://github.com/arcanedev-maroc
[link-github-repo]: https://github.com/ARCANEDEV/SEO-Helper
+[link-github-status]: https://github.com/ARCANEDEV/SEO-Helper/actions
[link-github-issues]: https://github.com/ARCANEDEV/SEO-Helper/issues
[link-contributors]: https://github.com/ARCANEDEV/SEO-Helper/graphs/contributors
[link-packagist]: https://packagist.org/packages/arcanedev/seo-helper
diff --git a/composer.json b/composer.json
index cc0a36d..596b8ee 100644
--- a/composer.json
+++ b/composer.json
@@ -19,7 +19,7 @@
"require": {
"php": ">=7.2.0",
"arcanedev/php-html": "^3.0",
- "arcanedev/support": "^5.0"
+ "arcanedev/support": "^5.1"
},
"require-dev": {
"ext-dom": "*",
diff --git a/src/Bases/MetaCollection.php b/src/Bases/MetaCollection.php
index b557437..a033001 100644
--- a/src/Bases/MetaCollection.php
+++ b/src/Bases/MetaCollection.php
@@ -1,4 +1,8 @@
-content = array_map(function ($keyword) {
return $this->clean($keyword);
- }, $content);
+ }, (array) $content);
return $this;
}
@@ -111,7 +113,7 @@ public function set($content)
*
* @param array|string $keywords
*
- * @return self
+ * @return $this
*/
public static function make($keywords)
{
@@ -123,7 +125,7 @@ public static function make($keywords)
*
* @param string $keyword
*
- * @return self
+ * @return $this
*/
public function add($keyword)
{
@@ -137,7 +139,7 @@ public function add($keyword)
*
* @param array $keywords
*
- * @return self
+ * @return $this
*/
public function addMany(array $keywords)
{
diff --git a/src/Entities/MetaCollection.php b/src/Entities/MetaCollection.php
index e706938..b3afb4c 100644
--- a/src/Entities/MetaCollection.php
+++ b/src/Entities/MetaCollection.php
@@ -1,4 +1,8 @@
-images) == 1) {
- $this->addMeta('image', $this->images[0]);
-
- return;
- }
-
- foreach ($this->images as $number => $url) {
- $this->addMeta("image{$number}", $url);
- }
- }
-
/**
* Reset the card.
*
- * @return \Arcanedev\SeoHelper\Entities\Twitter\Card
+ * @return $this
*/
public function reset()
{
@@ -319,6 +307,22 @@ private function checkSite(string &$site): void
| -----------------------------------------------------------------
*/
+ /**
+ * Render card images.
+ */
+ private function loadImages(): void
+ {
+ if (count($this->images) == 1) {
+ $this->addMeta('image', $this->images[0]);
+
+ return;
+ }
+
+ foreach ($this->images as $number => $url) {
+ $this->addMeta("image{$number}", $url);
+ }
+ }
+
/**
* Prepare username.
*
diff --git a/src/Entities/Twitter/MetaCollection.php b/src/Entities/Twitter/MetaCollection.php
index b9632b9..b1a42d3 100644
--- a/src/Entities/Twitter/MetaCollection.php
+++ b/src/Entities/Twitter/MetaCollection.php
@@ -1,4 +1,8 @@
-setSeoMeta($seoMeta);
$this->setSeoOpenGraph($seoOpenGraph);
@@ -82,7 +86,7 @@ public function meta()
*
* @param \Arcanedev\SeoHelper\Contracts\SeoMeta $seoMeta
*
- * @return \Arcanedev\SeoHelper\SeoHelper
+ * @return $this
*/
public function setSeoMeta(SeoMetaContract $seoMeta)
{
@@ -118,7 +122,7 @@ public function og()
*
* @param \Arcanedev\SeoHelper\Contracts\SeoOpenGraph $seoOpenGraph
*
- * @return \Arcanedev\SeoHelper\SeoHelper
+ * @return $this
*/
public function setSeoOpenGraph(SeoOpenGraphContract $seoOpenGraph)
{
@@ -142,7 +146,7 @@ public function twitter()
*
* @param \Arcanedev\SeoHelper\Contracts\SeoTwitter $seoTwitter
*
- * @return \Arcanedev\SeoHelper\SeoHelper
+ * @return $this
*/
public function setSeoTwitter(SeoTwitterContract $seoTwitter)
{
@@ -158,7 +162,7 @@ public function setSeoTwitter(SeoTwitterContract $seoTwitter)
* @param string|null $siteName
* @param string|null $separator
*
- * @return \Arcanedev\SeoHelper\SeoHelper
+ * @return $this
*/
public function setTitle($title, $siteName = null, $separator = null)
{
@@ -229,7 +233,7 @@ public function setDescription($description)
*
* @param array|string $keywords
*
- * @return \Arcanedev\SeoHelper\SeoHelper
+ * @return $this
*/
public function setKeywords($keywords)
{
@@ -243,7 +247,7 @@ public function setKeywords($keywords)
*
* @param string $imageUrl
*
- * @return \Arcanedev\SeoHelper\SeoHelper
+ * @return $this
*/
public function setImage($imageUrl)
{
@@ -255,10 +259,10 @@ public function setImage($imageUrl)
/**
* Set the current URL.
- *
+ *
* @param string $url
*
- * @return \Arcanedev\SeoHelper\SeoHelper
+ * @return $this
*/
public function setUrl($url)
{
@@ -312,7 +316,7 @@ public function __toString()
/**
* Enable the OpenGraph.
*
- * @return \Arcanedev\SeoHelper\SeoHelper
+ * @return $this
*/
public function enableOpenGraph()
{
@@ -324,7 +328,7 @@ public function enableOpenGraph()
/**
* Disable the OpenGraph.
*
- * @return \Arcanedev\SeoHelper\SeoHelper
+ * @return $this
*/
public function disableOpenGraph()
{
@@ -336,7 +340,7 @@ public function disableOpenGraph()
/**
* Enable the Twitter Card.
*
- * @return \Arcanedev\SeoHelper\SeoHelper
+ * @return $this
*/
public function enableTwitter()
{
@@ -348,7 +352,7 @@ public function enableTwitter()
/**
* Disable the Twitter Card.
*
- * @return \Arcanedev\SeoHelper\SeoHelper
+ * @return $this
*/
public function disableTwitter()
{
diff --git a/src/SeoHelperServiceProvider.php b/src/SeoHelperServiceProvider.php
index 0083d4d..eb7cdc3 100644
--- a/src/SeoHelperServiceProvider.php
+++ b/src/SeoHelperServiceProvider.php
@@ -1,4 +1,8 @@
-title(
new Entities\Title($this->getConfig('title', []))
@@ -289,7 +295,7 @@ public function setTitle($title, $siteName = null, $separator = null)
*
* @param string $siteName
*
- * @return self
+ * @return $this
*/
public function setSiteName($siteName)
{
@@ -313,7 +319,7 @@ public function hideSiteName()
/**
* Show site name.
*
- * @return self
+ * @return $this
*/
public function showSiteName()
{
diff --git a/src/SeoOpenGraph.php b/src/SeoOpenGraph.php
index 5fadb71..7059444 100644
--- a/src/SeoOpenGraph.php
+++ b/src/SeoOpenGraph.php
@@ -1,4 +1,8 @@
-enabled = $enabled;
-
- return $this;
- }
-
/**
* Set the Open Graph instance.
*
@@ -246,6 +236,20 @@ public function addProperty($property, $content)
return $this;
}
+ /**
+ * Set the enabled status for the OpenGraph.
+ *
+ * @param bool $enabled
+ *
+ * @return \Arcanedev\SeoHelper\SeoOpenGraph
+ */
+ private function setEnabled(bool $enabled)
+ {
+ $this->enabled = $enabled;
+
+ return $this;
+ }
+
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
diff --git a/src/SeoTwitter.php b/src/SeoTwitter.php
index 3140074..4d3482c 100644
--- a/src/SeoTwitter.php
+++ b/src/SeoTwitter.php
@@ -1,4 +1,8 @@
-enabled = (bool) $enabled;
-
- return $this;
- }
-
/**
* Set the Twitter Card instance.
*
* @param \Arcanedev\SeoHelper\Contracts\Entities\TwitterCard $card
*
- * @return \Arcanedev\SeoHelper\SeoTwitter
+ * @return $this
*/
public function setCard(CardContract $card)
{
@@ -98,7 +88,7 @@ public function setCard(CardContract $card)
*
* @param string $type
*
- * @return \Arcanedev\SeoHelper\SeoTwitter
+ * @return $this
*/
public function setType($type)
{
@@ -112,7 +102,7 @@ public function setType($type)
*
* @param string $site
*
- * @return \Arcanedev\SeoHelper\SeoTwitter
+ * @return $this
*/
public function setSite($site)
{
@@ -126,7 +116,7 @@ public function setSite($site)
*
* @param string $title
*
- * @return \Arcanedev\SeoHelper\SeoTwitter
+ * @return $this
*/
public function setTitle($title)
{
@@ -140,7 +130,7 @@ public function setTitle($title)
*
* @param string $description
*
- * @return \Arcanedev\SeoHelper\SeoTwitter
+ * @return $this
*/
public function setDescription($description)
{
@@ -154,7 +144,7 @@ public function setDescription($description)
*
* @param string $url
*
- * @return \Arcanedev\SeoHelper\SeoTwitter
+ * @return $this
*/
public function addImage($url)
{
@@ -168,7 +158,7 @@ public function addImage($url)
*
* @param array $metas
*
- * @return \Arcanedev\SeoHelper\SeoTwitter
+ * @return $this
*/
public function addMetas(array $metas)
{
@@ -183,7 +173,7 @@ public function addMetas(array $metas)
* @param string $name
* @param string $content
*
- * @return \Arcanedev\SeoHelper\SeoTwitter
+ * @return $this
*/
public function addMeta($name, $content)
{
@@ -192,6 +182,20 @@ public function addMeta($name, $content)
return $this;
}
+ /**
+ * Set the enabled status for the Twitter Card.
+ *
+ * @param bool $enabled
+ *
+ * @return $this
+ */
+ private function setEnabled(bool $enabled)
+ {
+ $this->enabled = $enabled;
+
+ return $this;
+ }
+
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
@@ -200,7 +204,7 @@ public function addMeta($name, $content)
/**
* Reset the Twitter Card.
*
- * @return \Arcanedev\SeoHelper\SeoTwitter
+ * @return $this
*/
public function reset()
{
@@ -232,7 +236,7 @@ public function __toString()
/**
* Enable the Twitter Card.
*
- * @return \Arcanedev\SeoHelper\SeoTwitter
+ * @return $this
*/
public function enable()
{
@@ -242,7 +246,7 @@ public function enable()
/**
* Disable the Twitter Card.
*
- * @return \Arcanedev\SeoHelper\SeoTwitter
+ * @return $this
*/
public function disable()
{
diff --git a/src/Traits/Seoable.php b/src/Traits/Seoable.php
index a4d54fb..a86d6df 100644
--- a/src/Traits/Seoable.php
+++ b/src/Traits/Seoable.php
@@ -1,4 +1,8 @@
-loadHTML(preg_replace('/>\s+', '><', $html));
diff --git a/tests/Entities/AnalyticsTest.php b/tests/Entities/AnalyticsTest.php
index f79eed8..a214dd6 100644
--- a/tests/Entities/AnalyticsTest.php
+++ b/tests/Entities/AnalyticsTest.php
@@ -1,4 +1,8 @@
-analytics = new Analytics;
@@ -67,7 +71,7 @@ public function it_must_render_empty_on_init()
}
/** @test */
- public function it_can_render()
+ public function it_can_render(): void
{
$expectations = [
'';
@@ -121,7 +126,7 @@ public function it_can_clean_and_render()
}
/** @test */
- public function it_can_make_meta_with_custom_name_property()
+ public function it_can_make_meta_with_custom_name_property(): void
{
$meta = Meta::make('title', 'Hello World', 'property', 'og:');
@@ -132,7 +137,7 @@ public function it_can_make_meta_with_custom_name_property()
}
/** @test */
- public function it_can_set_name_property()
+ public function it_can_set_name_property(): void
{
$meta = Meta::make('title', 'Hello World');
@@ -146,25 +151,25 @@ public function it_can_set_name_property()
}
/** @test */
- public function it_must_throw_an_invalid_argument_exception_on_invalid_type()
+ public function it_must_throw_an_invalid_argument_exception_on_invalid_type(): void
{
- $this->expectException(\Arcanedev\SeoHelper\Exceptions\InvalidArgumentException::class);
+ $this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('The meta name property is must be a string value, NULL is given.');
Meta::make('title', 'Hello World')->setNameProperty(null);
}
/** @test */
- public function it_must_throw_an_invalid_argument_exception_on_not_allowed_name()
+ public function it_must_throw_an_invalid_argument_exception_on_not_allowed_name(): void
{
- $this->expectException(\Arcanedev\SeoHelper\Exceptions\InvalidArgumentException::class);
+ $this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage("The meta name property [foo] is not supported, the allowed name properties are ['charset', 'http-equiv', 'itemprop', 'name', 'property'].");
Meta::make('title', 'Hello World')->setNameProperty('foo');
}
/** @test */
- public function it_can_render_array_content()
+ public function it_can_render_array_content(): void
{
$meta = Meta::make('locale:alternate', ['fr_FR', 'es_ES', 'en_GB']);
diff --git a/tests/SeoHelperServiceProviderTest.php b/tests/SeoHelperServiceProviderTest.php
index 0f340af..5f6fec7 100644
--- a/tests/SeoHelperServiceProviderTest.php
+++ b/tests/SeoHelperServiceProviderTest.php
@@ -1,4 +1,8 @@
-seoHelper = seo_helper();
$expectations = [
@@ -72,7 +76,7 @@ public function it_can_be_instantiated_with_helper()
}
/** @test */
- public function it_can_get_seo_meta()
+ public function it_can_get_seo_meta(): void
{
$seoMeta = $this->seoHelper->meta();
@@ -88,7 +92,7 @@ public function it_can_get_seo_meta()
}
/** @test */
- public function it_can_get_seo_open_graph()
+ public function it_can_get_seo_open_graph(): void
{
$ogs = [
$this->seoHelper->openGraph(),
@@ -109,7 +113,7 @@ public function it_can_get_seo_open_graph()
}
/** @test */
- public function it_can_set_and_render_title()
+ public function it_can_set_and_render_title(): void
{
$title = 'Hello World';
$siteName = 'ARCANEDEV';
@@ -130,7 +134,7 @@ public function it_can_set_and_render_title()
}
/** @test */
- public function it_can_set_and_render_site_name()
+ public function it_can_set_and_render_site_name(): void
{
$title = 'My Application';
$siteName = 'ARCANEDEV';
@@ -151,7 +155,7 @@ public function it_can_set_and_render_site_name()
}
/** @test */
- public function it_can_toggle_site_name_visibility()
+ public function it_can_toggle_site_name_visibility(): void
{
$title = 'My Application';
$siteName = 'ARCANEDEV';
@@ -179,7 +183,7 @@ public function it_can_toggle_site_name_visibility()
}
/** @test */
- public function it_can_set_and_render_description()
+ public function it_can_set_and_render_description(): void
{
$description = 'ARCANEDEV super description';
$expectations = [
@@ -197,7 +201,7 @@ public function it_can_set_and_render_description()
}
/** @test */
- public function it_can_set_and_render_keywords()
+ public function it_can_set_and_render_keywords(): void
{
$keywords = $this->getSeoHelperConfig('keywords.default');
$expected = '';
@@ -214,7 +218,7 @@ public function it_can_set_and_render_keywords()
}
/** @test */
- public function it_can_set_and_render_image()
+ public function it_can_set_and_render_image(): void
{
$this->seoHelper->setImage($imageUrl = 'http://localhost/assets/img/logo.png');
@@ -229,9 +233,9 @@ public function it_can_set_and_render_image()
static::assertStringContainsString($expected, $rendered);
}
}
-
+
/** @test */
- public function it_can_set_and_render_url()
+ public function it_can_set_and_render_url(): void
{
$this->seoHelper->setUrl($url = 'http://localhost/path');
@@ -248,7 +252,7 @@ public function it_can_set_and_render_url()
}
/** @test */
- public function it_can_render_all()
+ public function it_can_render_all(): void
{
$output = $this->seoHelper->render();
@@ -256,7 +260,7 @@ public function it_can_render_all()
}
/** @test */
- public function it_can_render_all_with_html_string_object()
+ public function it_can_render_all_with_html_string_object(): void
{
$output = $this->seoHelper->renderHtml();
@@ -265,7 +269,7 @@ public function it_can_render_all_with_html_string_object()
}
/** @test */
- public function it_can_enable_and_disable_open_graph()
+ public function it_can_enable_and_disable_open_graph(): void
{
$needle = 'seoMeta = $this->app[SeoMetaContract::class];
@@ -73,7 +77,7 @@ public function it_can_be_instantiated_by_container()
}
/** @test */
- public function it_can_set_and_get_and_render_title()
+ public function it_can_set_and_get_and_render_title(): void
{
$title = 'Awesome Title';
$siteName = $this->getSeoHelperConfig('title.site-name');
@@ -118,7 +122,7 @@ public function it_can_set_and_get_and_render_title()
}
/** @test */
- public function it_can_set_and_get_and_render_description()
+ public function it_can_set_and_get_and_render_description(): void
{
$description = 'Awesome Description';
$this->seoMeta->setDescription($description);
@@ -143,7 +147,7 @@ public function it_can_set_and_get_and_render_description()
}
/** @test */
- public function it_can_set_and_get_and_render_keywords()
+ public function it_can_set_and_get_and_render_keywords(): void
{
$keywords = ['keyword-1', 'keyword-2', 'keyword-3', 'keyword-4', 'keyword-5'];
@@ -183,7 +187,7 @@ public function it_can_set_and_get_and_render_keywords()
}
/** @test */
- public function it_can_add_one_keyword()
+ public function it_can_add_one_keyword(): void
{
$keywords = ['keyword-1', 'keyword-2', 'keyword-3', 'keyword-4', 'keyword-5'];
$this->seoMeta->setKeywords($keywords);
@@ -203,7 +207,7 @@ public function it_can_add_one_keyword()
}
/** @test */
- public function it_can_add_many_keywords()
+ public function it_can_add_many_keywords(): void
{
$keywords = ['keyword-1', 'keyword-2', 'keyword-3', 'keyword-4', 'keyword-5'];
$expected = '';
@@ -223,7 +227,7 @@ public function it_can_add_many_keywords()
}
/** @test */
- public function it_can_add_remove_reset_and_render_a_misc_tag()
+ public function it_can_add_remove_reset_and_render_a_misc_tag(): void
{
$expectations = [
'',
@@ -306,7 +310,7 @@ public function it_can_add_remove_reset_and_render_a_misc_tag()
}
/** @test */
- public function it_can_render_add_reset_webmasters()
+ public function it_can_render_add_reset_webmasters(): void
{
$expectations = [
'',
@@ -350,7 +354,7 @@ public function it_can_render_add_reset_webmasters()
}
/** @test */
- public function it_can_set_and_render_google_analytics()
+ public function it_can_set_and_render_google_analytics(): void
{
static::assertStringContainsString(
"ga('create', 'UA-12345678-9', 'auto');",
@@ -386,7 +390,7 @@ public function it_can_set_and_render_google_analytics()
*
* @param \Arcanedev\SeoHelper\Contracts\Entities\MetaCollection $metas
*/
- protected static function assertMetaCollection($metas)
+ protected static function assertMetaCollection($metas): void
{
$expectations = [
\Arcanedev\SeoHelper\Contracts\Entities\MetaCollection::class,
diff --git a/tests/SeoOpenGraphTest.php b/tests/SeoOpenGraphTest.php
index 7dcdd8d..6d9dfb1 100644
--- a/tests/SeoOpenGraphTest.php
+++ b/tests/SeoOpenGraphTest.php
@@ -1,4 +1,8 @@
-',
@@ -73,7 +77,7 @@ public function it_can_render_defaults()
}
/** @test */
- public function it_can_set_and_render_prefix()
+ public function it_can_set_and_render_prefix(): void
{
$this->seoOpenGraph->setPrefix('open-graph:');
@@ -90,7 +94,7 @@ public function it_can_set_and_render_prefix()
}
/** @test */
- public function it_can_set_and_render_type()
+ public function it_can_set_and_render_type(): void
{
$types = [
'article',
@@ -110,7 +114,7 @@ public function it_can_set_and_render_type()
}
/** @test */
- public function it_can_set_and_render_title()
+ public function it_can_set_and_render_title(): void
{
$title = 'Hello World';
@@ -123,7 +127,7 @@ public function it_can_set_and_render_title()
}
/** @test */
- public function it_can_set_and_render_description()
+ public function it_can_set_and_render_description(): void
{
$description = 'Hello World detailed description.';
@@ -136,7 +140,7 @@ public function it_can_set_and_render_description()
}
/** @test */
- public function it_can_set_and_render_url()
+ public function it_can_set_and_render_url(): void
{
$url = 'http://www.imdb.com/title/tt0080339/';
@@ -149,7 +153,7 @@ public function it_can_set_and_render_url()
}
/** @test */
- public function it_can_set_and_render_image()
+ public function it_can_set_and_render_image(): void
{
$image = 'http://ia.media-imdb.com/images/M/MV5BNDU2MjE4MTcwNl5BMl5BanBnXkFtZTgwNDExOTMxMDE@._V1_UY1200_CR90,0,630,1200_AL_.jpg';
@@ -162,7 +166,7 @@ public function it_can_set_and_render_image()
}
/** @test */
- public function it_can_set_and_render_site_name()
+ public function it_can_set_and_render_site_name(): void
{
$siteName = 'My site name';
@@ -175,7 +179,7 @@ public function it_can_set_and_render_site_name()
}
/** @test */
- public function it_can_add_and_render_property()
+ public function it_can_add_and_render_property(): void
{
$locales = [
'ar', 'en', 'en_US', 'es', 'fr', 'fr_FR',
@@ -192,7 +196,7 @@ public function it_can_add_and_render_property()
}
/** @test */
- public function it_can_add_render_properties()
+ public function it_can_add_render_properties(): void
{
$properties = [
'locale' => 'en_GB',
@@ -214,7 +218,7 @@ public function it_can_add_render_properties()
}
/** @test */
- public function it_can_enable_and_disable()
+ public function it_can_enable_and_disable(): void
{
static::assertTrue($this->seoOpenGraph->isEnabled());
static::assertFalse($this->seoOpenGraph->isDisabled());
@@ -234,7 +238,7 @@ public function it_can_enable_and_disable()
}
/** @test */
- public function it_can_set_and_render_locale_property()
+ public function it_can_set_and_render_locale_property(): void
{
$locales = ['fr_FR', 'en_GB', 'es_ES'];
@@ -247,7 +251,7 @@ public function it_can_set_and_render_locale_property()
}
/** @test */
- public function it_can_set_and_render_alternative_properties()
+ public function it_can_set_and_render_alternative_properties(): void
{
$this->seoOpenGraph->setAlternativeLocales(['fr_FR', 'en_GB', 'es_ES']);
diff --git a/tests/SeoTwitterTest.php b/tests/SeoTwitterTest.php
index df61316..ba67e81 100644
--- a/tests/SeoTwitterTest.php
+++ b/tests/SeoTwitterTest.php
@@ -1,4 +1,8 @@
-seoTwitter->render();
@@ -74,7 +78,7 @@ public function it_can_render_defaults()
}
/** @test */
- public function it_can_set_and_render_type()
+ public function it_can_set_and_render_type(): void
{
$this->seoTwitter->setType('app');
@@ -85,7 +89,7 @@ public function it_can_set_and_render_type()
}
/** @test */
- public function it_can_set_and_render_site()
+ public function it_can_set_and_render_site(): void
{
$this->seoTwitter->setSite('Arcanedev');
@@ -96,7 +100,7 @@ public function it_can_set_and_render_site()
}
/** @test */
- public function it_can_set_and_render_title()
+ public function it_can_set_and_render_title(): void
{
$this->seoTwitter->setTitle('ARCANEDEV super title');
@@ -107,7 +111,7 @@ public function it_can_set_and_render_title()
}
/** @test */
- public function it_can_set_and_render_description()
+ public function it_can_set_and_render_description(): void
{
$this->seoTwitter->setDescription('ARCANEDEV super description');
@@ -118,7 +122,7 @@ public function it_can_set_and_render_description()
}
/** @test */
- public function it_can_add_and_render_image()
+ public function it_can_add_and_render_image(): void
{
$this->seoTwitter->addImage('http://example.com/img/avatar.png');
@@ -129,7 +133,7 @@ public function it_can_add_and_render_image()
}
/** @test */
- public function it_can_reset_card()
+ public function it_can_reset_card(): void
{
$expected = $this->seoTwitter->render();
@@ -146,7 +150,7 @@ public function it_can_reset_card()
}
/** @test */
- public function it_can_add_and_render_a_meta()
+ public function it_can_add_and_render_a_meta(): void
{
$this->seoTwitter->addMeta('creator', '@Arcanedev');
@@ -157,7 +161,7 @@ public function it_can_add_and_render_a_meta()
}
/** @test */
- public function it_can_add_and_render_many_metas()
+ public function it_can_add_and_render_many_metas(): void
{
$metas = [
'creator' => '@Arcanedev',
@@ -179,7 +183,7 @@ public function it_can_add_and_render_many_metas()
}
/** @test */
- public function it_can_enable_and_disable()
+ public function it_can_enable_and_disable(): void
{
static::assertTrue($this->seoTwitter->isEnabled());
static::assertFalse($this->seoTwitter->isDisabled());
diff --git a/tests/Stubs/Dummy.php b/tests/Stubs/Dummy.php
index aa7fde0..fd6c50b 100644
--- a/tests/Stubs/Dummy.php
+++ b/tests/Stubs/Dummy.php
@@ -1,4 +1,8 @@
-set('seo-helper.keywords', [
@@ -94,7 +84,7 @@ protected function getEnvironmentSetUp($app)
/**
* Get Config instance.
*
- * @return \Illuminate\Config\Repository
+ * @return \Illuminate\Contracts\Config\Repository
*/
protected function config()
{
diff --git a/tests/Traits/SeoableTest.php b/tests/Traits/SeoableTest.php
index 7e112ef..d37cd9f 100644
--- a/tests/Traits/SeoableTest.php
+++ b/tests/Traits/SeoableTest.php
@@ -1,4 +1,8 @@
-dummy->seo();
@@ -60,7 +64,7 @@ public function it_can_get_main_helper()
}
/** @test */
- public function it_can_get_meta_helper()
+ public function it_can_get_meta_helper(): void
{
$seoMeta = $this->dummy->seoMeta();
@@ -76,7 +80,7 @@ public function it_can_get_meta_helper()
}
/** @test */
- public function it_can_get_open_graph_helper()
+ public function it_can_get_open_graph_helper(): void
{
$seoOpenGraph = $this->dummy->seoGraph();
@@ -92,7 +96,7 @@ public function it_can_get_open_graph_helper()
}
/** @test */
- public function it_can_get_twitter_card_helper()
+ public function it_can_get_twitter_card_helper(): void
{
$seoTwitter = $this->dummy->seoCard();
$expectations = [
@@ -107,7 +111,7 @@ public function it_can_get_twitter_card_helper()
}
/** @test */
- public function it_can_set_and_render_title()
+ public function it_can_set_and_render_title(): void
{
$title = 'Hello World';
$siteName = 'ARCANEDEV';
@@ -130,7 +134,7 @@ public function it_can_set_and_render_title()
}
/** @test */
- public function it_can_set_and_render_description()
+ public function it_can_set_and_render_description(): void
{
$description = 'ARCANEDEV super description';
$expectations = [
@@ -151,7 +155,7 @@ public function it_can_set_and_render_description()
}
/** @test */
- public function it_can_set_and_render_keywords()
+ public function it_can_set_and_render_keywords(): void
{
$keywords = $this->getSeoHelperConfig('keywords.default');
$expected = '';