Skip to content

Commit

Permalink
make compatible with crawler v8
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Oct 24, 2023
1 parent 27a6215 commit 1d7989d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `laravel-sitemap` will be documented in this file

## 7.0.0 - 2023-10-24

- add compatibility with spatie/crawler v8

## 6.4.0 - 2023-10-18

### What's Changed
Expand Down
4 changes: 4 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Upgrading

## From 6.0 to 7.0

- `spatie/crawler` is updated to `^8.0`.

## From 5.0 to 6.0

No API changes were made. If you're on PHP 8, you should be able to upgrade from v5 to v6 without having to make any changes.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"guzzlehttp/guzzle": "^7.2",
"illuminate/support": "^8.0|^9.0|^10.0",
"nesbot/carbon": "^2.63",
"spatie/crawler": "^7.0",
"spatie/crawler": "^8.0",
"spatie/laravel-package-tools": "^1.5",
"symfony/dom-crawler": "^5.1.14|^6.0"
},
Expand Down
8 changes: 5 additions & 3 deletions src/Crawler/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(callable $hasCrawled)
*
* @param \Psr\Http\Message\UriInterface $url
*/
public function willCrawl(UriInterface $url): void
public function willCrawl(UriInterface $url, ?string $linkText): void
{
}

Expand All @@ -43,7 +43,8 @@ public function finishedCrawling(): void
public function crawled(
UriInterface $url,
ResponseInterface $response,
?UriInterface $foundOnUrl = null
?UriInterface $foundOnUrl = null,
?string $linkText = null,
): void {
($this->hasCrawled)($url, $response);
}
Expand All @@ -58,7 +59,8 @@ public function crawled(
public function crawlFailed(
UriInterface $url,
RequestException $requestException,
?UriInterface $foundOnUrl = null
?UriInterface $foundOnUrl = null,
?string $linkText = null,
): void {
}
}

0 comments on commit 1d7989d

Please sign in to comment.