Skip to content

Commit 3f1ee79

Browse files
Merge pull request #51 from ARCANEDEV/update-package
Updating the package
2 parents d6264bd + 4dac4c3 commit 3f1ee79

22 files changed

+223
-328
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
language: php
22

3-
sudo: false
4-
53
php:
64
- 7.2
75
- 7.3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/SEO-Helper/re
2525
* Easy setup & configuration.
2626
* Well documented & IDE Friendly.
2727
* Well tested with maximum code quality.
28-
* Laravel `5.0` to `6.0` are supported.
28+
* Laravel `5.x | 6.x` are supported.
2929
* Made with :heart: & :coffee:.
3030

3131
## Table of contents

_docs/0-Home.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SEO Helper is a package that provides tools and helpers for SEO (Search Engine O
1111
* Easy setup & configuration.
1212
* Well documented & IDE Friendly.
1313
* Well tested with maximum code quality.
14-
* Laravel `5.0` to `6.0` are supported.
14+
* Laravel `5.x | 6.x` are supported.
1515
* Made with :heart: & :coffee:.
1616

1717
## Table of contents

_docs/1-Installation-and-Setup.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
| ![SEO-Helper v1.5.x][seo_helper_1_5_x] | ![Laravel v5.6][laravel_5_6] |
2020
| ![SEO-Helper v1.6.x][seo_helper_1_6_x] | ![Laravel v5.7][laravel_5_7] |
2121
| ![SEO-Helper v1.7.x][seo_helper_1_7_x] | ![Laravel v5.8][laravel_5_8] |
22-
| ![SEO-Helper v2.0.x][seo_helper_2_0_x] | ![Laravel v6.0][laravel_6_0] |
22+
| ![SEO-Helper v2.x][seo_helper_2_x] | ![Laravel v6.x][laravel_6_x] |
2323

2424
[laravel_5_0]: https://img.shields.io/badge/v5.0-supported-brightgreen.svg?style=flat-square "Laravel v5.0"
2525
[laravel_5_1]: https://img.shields.io/badge/v5.1-supported-brightgreen.svg?style=flat-square "Laravel v5.1"
@@ -30,16 +30,16 @@
3030
[laravel_5_6]: https://img.shields.io/badge/v5.6-supported-brightgreen.svg?style=flat-square "Laravel v5.6"
3131
[laravel_5_7]: https://img.shields.io/badge/v5.7-supported-brightgreen.svg?style=flat-square "Laravel v5.7"
3232
[laravel_5_8]: https://img.shields.io/badge/v5.8-supported-brightgreen.svg?style=flat-square "Laravel v5.8"
33-
[laravel_6_0]: https://img.shields.io/badge/v6.0-supported-brightgreen.svg?style=flat-square "Laravel v6.0"
34-
35-
[seo_helper_1_1_x]: https://img.shields.io/badge/version-1.1.*-blue.svg?style=flat-square "SEO-Helper v1.1.*"
36-
[seo_helper_1_2_x]: https://img.shields.io/badge/version-1.2.*-blue.svg?style=flat-square "SEO-Helper v1.2.*"
37-
[seo_helper_1_3_x]: https://img.shields.io/badge/version-1.3.*-blue.svg?style=flat-square "SEO-Helper v1.3.*"
38-
[seo_helper_1_4_x]: https://img.shields.io/badge/version-1.4.*-blue.svg?style=flat-square "SEO-Helper v1.4.*"
39-
[seo_helper_1_5_x]: https://img.shields.io/badge/version-1.5.*-blue.svg?style=flat-square "SEO-Helper v1.5.*"
40-
[seo_helper_1_6_x]: https://img.shields.io/badge/version-1.6.*-blue.svg?style=flat-square "SEO-Helper v1.6.*"
41-
[seo_helper_1_7_x]: https://img.shields.io/badge/version-1.7.*-blue.svg?style=flat-square "SEO-Helper v1.7.*"
42-
[seo_helper_2_0_x]: https://img.shields.io/badge/version-2.0.*-blue.svg?style=flat-square "SEO-Helper v2.0.*"
33+
[laravel_6_x]: https://img.shields.io/badge/v6.x-supported-brightgreen.svg?style=flat-square "Laravel v6.x"
34+
35+
[seo_helper_1_1_x]: https://img.shields.io/badge/version-1.1.x-blue.svg?style=flat-square "SEO-Helper v1.1.x"
36+
[seo_helper_1_2_x]: https://img.shields.io/badge/version-1.2.x-blue.svg?style=flat-square "SEO-Helper v1.2.x"
37+
[seo_helper_1_3_x]: https://img.shields.io/badge/version-1.3.x-blue.svg?style=flat-square "SEO-Helper v1.3.x"
38+
[seo_helper_1_4_x]: https://img.shields.io/badge/version-1.4.x-blue.svg?style=flat-square "SEO-Helper v1.4.x"
39+
[seo_helper_1_5_x]: https://img.shields.io/badge/version-1.5.x-blue.svg?style=flat-square "SEO-Helper v1.5.x"
40+
[seo_helper_1_6_x]: https://img.shields.io/badge/version-1.6.x-blue.svg?style=flat-square "SEO-Helper v1.6.x"
41+
[seo_helper_1_7_x]: https://img.shields.io/badge/version-1.7.x-blue.svg?style=flat-square "SEO-Helper v1.7.x"
42+
[seo_helper_2_x]: https://img.shields.io/badge/version-2.x-blue.svg?style=flat-square "SEO-Helper v2.x"
4343

4444
## Composer
4545

_docs/2-Configuration.md

Lines changed: 113 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,116 @@
88
4. [API](4-API.md)
99
5. [Extras](5-Extras.md)
1010

11-
> Coming Soon ...
11+
12+
```php
13+
<?php
14+
15+
return [
16+
17+
/* -----------------------------------------------------------------
18+
| Title
19+
| -----------------------------------------------------------------
20+
*/
21+
22+
'title' => [
23+
'default' => 'Default Title',
24+
'site-name' => config('app.name', 'My Application'),
25+
'separator' => '-',
26+
'first' => true,
27+
'max' => 55,
28+
],
29+
30+
/* -----------------------------------------------------------------
31+
| Description
32+
| -----------------------------------------------------------------
33+
*/
34+
35+
'description' => [
36+
'default' => 'Default description',
37+
'max' => 155,
38+
],
39+
40+
/* -----------------------------------------------------------------
41+
| Keywords
42+
| -----------------------------------------------------------------
43+
*/
44+
45+
'keywords' => [
46+
'default' => [
47+
//
48+
],
49+
],
50+
51+
/* -----------------------------------------------------------------
52+
| Miscellaneous
53+
| -----------------------------------------------------------------
54+
*/
55+
56+
'misc' => [
57+
'canonical' => true,
58+
'robots' => config('app.env') !== 'production', // Tell robots not to index the content if it's not on production
59+
'default' => [
60+
'viewport' => 'width=device-width, initial-scale=1', // Responsive design thing
61+
'author' => '', // https://plus.google.com/[YOUR PERSONAL G+ PROFILE HERE]
62+
'publisher' => '', // https://plus.google.com/[YOUR PERSONAL G+ PROFILE HERE]
63+
],
64+
],
65+
66+
/* -----------------------------------------------------------------
67+
| Webmaster Tools
68+
| -----------------------------------------------------------------
69+
*/
70+
71+
'webmasters' => [
72+
'google' => '',
73+
'bing' => '',
74+
'alexa' => '',
75+
'pinterest' => '',
76+
'yandex' => '',
77+
],
78+
79+
/* -----------------------------------------------------------------
80+
| Open Graph
81+
| -----------------------------------------------------------------
82+
*/
83+
84+
'open-graph' => [
85+
'enabled' => true,
86+
'prefix' => 'og:',
87+
'type' => 'website',
88+
'title' => 'Default Open Graph title',
89+
'description' => 'Default Open Graph description',
90+
'site-name' => '',
91+
'properties' => [
92+
//
93+
],
94+
],
95+
96+
/* -----------------------------------------------------------------
97+
| Twitter
98+
| -----------------------------------------------------------------
99+
| Supported card types : 'app', 'gallery', 'photo', 'player', 'product', 'summary', 'summary_large_image'.
100+
*/
101+
102+
'twitter' => [
103+
'enabled' => true,
104+
'prefix' => 'twitter:',
105+
'card' => 'summary',
106+
'site' => 'Username',
107+
'title' => 'Default Twitter Card title',
108+
'metas' => [
109+
//
110+
],
111+
],
112+
113+
/* -----------------------------------------------------------------
114+
| Analytics
115+
| -----------------------------------------------------------------
116+
*/
117+
118+
'analytics' => [
119+
'google' => '', // UA-XXXXXXXX-X
120+
],
121+
122+
];
123+
```

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
"license": "MIT",
1919
"require": {
2020
"php": ">=7.2.0",
21-
"arcanedev/php-html": "~3.0",
22-
"arcanedev/support": "~5.0.0"
21+
"arcanedev/php-html": "^3.0",
22+
"arcanedev/support": "^5.0"
2323
},
2424
"require-dev": {
2525
"ext-dom": "*",
26-
"orchestra/testbench": "~4.0.0",
27-
"phpunit/phpcov": "~6.0",
28-
"phpunit/phpunit": "~8.0"
26+
"orchestra/testbench": "^4.0",
27+
"phpunit/phpcov": "^6.0",
28+
"phpunit/phpunit": "^8.0"
2929
},
3030
"autoload": {
3131
"psr-4": {

helpers.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
*
99
* @return \Arcanedev\SeoHelper\Contracts\SeoHelper
1010
*/
11-
function seo_helper() {
11+
function seo_helper(): SeoHelper
12+
{
1213
return app(SeoHelper::class);
1314
}
1415
}

src/Entities/Description.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Description implements DescriptionContract
3131
*
3232
* @var string
3333
*/
34-
protected $name = 'description';
34+
protected $name = 'description';
3535

3636
/**
3737
* The meta content.
@@ -45,7 +45,7 @@ class Description implements DescriptionContract
4545
*
4646
* @var int
4747
*/
48-
protected $max = 155;
48+
protected $max = 155;
4949

5050
/* -----------------------------------------------------------------
5151
| Constructor
@@ -182,7 +182,7 @@ public function __toString()
182182
*
183183
* @return bool
184184
*/
185-
private function hasContent()
185+
private function hasContent(): bool
186186
{
187187
return ! empty($this->get());
188188
}
@@ -194,7 +194,7 @@ private function hasContent()
194194
*
195195
* @throws \Arcanedev\SeoHelper\Exceptions\InvalidArgumentException
196196
*/
197-
private function checkMax($max)
197+
private function checkMax($max): void
198198
{
199199
if ( ! is_int($max)) {
200200
throw new InvalidArgumentException(

src/Entities/Keywords.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function __toString()
183183
*
184184
* @return bool
185185
*/
186-
private function hasContent()
186+
private function hasContent(): bool
187187
{
188188
return ! empty($this->getContent());
189189
}
@@ -200,7 +200,7 @@ private function hasContent()
200200
*
201201
* @return string
202202
*/
203-
private function clean($value)
203+
private function clean(string $value): string
204204
{
205205
return trim(strip_tags($value));
206206
}

src/Entities/MiscTags.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public function __toString()
207207
*
208208
* @return bool
209209
*/
210-
private function hasUrl()
210+
private function hasUrl(): bool
211211
{
212212
return ! empty($this->getUrl());
213213
}
@@ -217,7 +217,7 @@ private function hasUrl()
217217
*
218218
* @return bool
219219
*/
220-
private function isCanonicalEnabled()
220+
private function isCanonicalEnabled(): bool
221221
{
222222
return (bool) $this->getConfig('canonical', false);
223223
}
@@ -227,7 +227,7 @@ private function isCanonicalEnabled()
227227
*
228228
* @return bool
229229
*/
230-
private function isRobotsEnabled()
230+
private function isRobotsEnabled(): bool
231231
{
232232
return (bool) $this->getConfig('robots', false);
233233
}
@@ -242,7 +242,7 @@ private function isRobotsEnabled()
242242
*
243243
* @return \Arcanedev\SeoHelper\Entities\MiscTags
244244
*/
245-
private function addRobotsMeta()
245+
private function addRobotsMeta(): self
246246
{
247247
if ($this->isRobotsEnabled())
248248
$this->add('robots', 'noindex, nofollow');
@@ -255,7 +255,7 @@ private function addRobotsMeta()
255255
*
256256
* @return \Arcanedev\SeoHelper\Entities\MiscTags
257257
*/
258-
private function addCanonical()
258+
private function addCanonical(): self
259259
{
260260
if ($this->isCanonicalEnabled() && $this->hasUrl())
261261
$this->add('canonical', $this->currentUrl);

0 commit comments

Comments
 (0)