Declaration of App\Observers\CustomCrawlerObserver::crawled #436
-
hi folks, Declaration of App\Observers\CustomCrawlerObserver::crawled(Psr\Http\Message\UriInterface $url, Psr\Http\Message\ResponseInterface $response, ?Psr\Http\Message\UriInterface $foundOnUrl = null) must be compatible with Spatie\Crawler\CrawlObservers\CrawlObserver::crawled(Psr\Http\Message\UriInterface $url, Psr\Http\Message\ResponseInterface $response, ?Psr\Http\Message\UriInterface $foundOnUrl = null): void ` namespace App\Observers; use DOMDocument; class CustomCrawlerObserver extends CrawlObserver {
` Anyone a hint? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
found by myself, missed the : void :) |
Beta Was this translation helpful? Give feedback.
-
Had the same problem and this wasn't the solution. I noticed most people forget to list half of the parameters the functions need,apparently, which caused my errors.
Most people only seem to list the Uriinterface $url for the willCrawl() function for some reason? Same for the other functions. TLDR make sure you have got all the same parameters as in the CrawlObserver class. |
Beta Was this translation helpful? Give feedback.
found by myself, missed the : void :)