@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $this->sitemap = new Sitemap(); |
| 47 | 47 | |
| 48 | - $this->hasCrawled = function (Url $url, ResponseInterface $response = null) { |
|
| 48 | + $this->hasCrawled = function(Url $url, ResponseInterface $response = null) { |
|
| 49 | 49 | return $url; |
| 50 | 50 | }; |
| 51 | 51 | } |
@@ -101,12 +101,12 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | protected function getCrawlProfile(): Profile |
| 103 | 103 | { |
| 104 | - $shouldCrawl = function (CrawlerUrl $url) { |
|
| 104 | + $shouldCrawl = function(CrawlerUrl $url) { |
|
| 105 | 105 | if ($url->host !== CrawlerUrl::create($this->urlToBeCrawled)->host) { |
| 106 | 106 | return false; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - if (! is_callable($this->shouldCrawl)) { |
|
| 109 | + if (!is_callable($this->shouldCrawl)) { |
|
| 110 | 110 | return true; |
| 111 | 111 | } |
| 112 | 112 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | protected function getCrawlObserver(): Observer |
| 120 | 120 | { |
| 121 | - $performAfterUrlHasBeenCrawled = function (CrawlerUrl $crawlerUrl, ResponseInterface $response = null) { |
|
| 121 | + $performAfterUrlHasBeenCrawled = function(CrawlerUrl $crawlerUrl, ResponseInterface $response = null) { |
|
| 122 | 122 | $sitemapUrl = ($this->hasCrawled)(Url::create($crawlerUrl), $response); |
| 123 | 123 | |
| 124 | 124 | if ($sitemapUrl) { |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public function getSitemap(string $url) |
| 45 | 45 | { |
| 46 | - return collect($this->tags)->first(function (Tag $tag) use ($url) { |
|
| 46 | + return collect($this->tags)->first(function(Tag $tag) use ($url) { |
|
| 47 | 47 | return $tag->getType() === 'sitemap' && $tag->url === $url; |
| 48 | 48 | }); |
| 49 | 49 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | $this->app->when(SitemapGenerator::class) |
| 26 | 26 | ->needs(Crawler::class) |
| 27 | - ->give(function () { |
|
| 27 | + ->give(function() { |
|
| 28 | 28 | return Crawler::create(config('sitemap.guzzle_options')); |
| 29 | 29 | }); |
| 30 | 30 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function getUrl(string $url) |
| 43 | 43 | { |
| 44 | - return collect($this->tags)->first(function (Tag $tag) use ($url) { |
|
| 44 | + return collect($this->tags)->first(function(Tag $tag) use ($url) { |
|
| 45 | 45 | return $tag->getType() === 'url' && $tag->url === $url; |
| 46 | 46 | }); |
| 47 | 47 | } |
@@ -137,13 +137,13 @@ |
||
| 137 | 137 | public function segments(int $index = null) |
| 138 | 138 | { |
| 139 | 139 | $segments = collect(explode('/', $this->path())) |
| 140 | - ->filter(function ($value) { |
|
| 140 | + ->filter(function($value) { |
|
| 141 | 141 | return $value !== ''; |
| 142 | 142 | }) |
| 143 | 143 | ->values() |
| 144 | 144 | ->toArray(); |
| 145 | 145 | |
| 146 | - if (! is_null($index)) { |
|
| 146 | + if (!is_null($index)) { |
|
| 147 | 147 | return $this->segment($index); |
| 148 | 148 | } |
| 149 | 149 | |