spatie / crawler

An easy to use, powerful crawler implemented in PHP. Can execute Javascript.
https://freek.dev/308-building-a-crawler-in-php
MIT License
2.51k stars 357 forks source link

Deprecations of implemented interfaces since PHP 8.1 for `CrawlObserverCollection` class #395

Closed Rezyan closed 2 years ago

Rezyan commented 2 years ago

Hi,

This issue is related to this one from the spatie/laravel-sitemap repository. Since the PHP 8.1 version, the CrawlObserverCollection class emits deprecations due to the implemented interfaces.

PHP Deprecated:  Return type of Spatie\Crawler\CrawlObservers\CrawlObserverCollection::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/spatie/crawler/src/CrawlObservers/CrawlObserverCollection.php on line 66
PHP Deprecated:  Return type of Spatie\Crawler\CrawlObservers\CrawlObserverCollection::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/spatie/crawler/src/CrawlObservers/CrawlObserverCollection.php on line 52
PHP Deprecated:  Return type of Spatie\Crawler\CrawlObservers\CrawlObserverCollection::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/spatie/crawler/src/CrawlObservers/CrawlObserverCollection.php on line 57
PHP Deprecated:  Return type of Spatie\Crawler\CrawlObservers\CrawlObserverCollection::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/spatie/crawler/src/CrawlObservers/CrawlObserverCollection.php on line 71
PHP Deprecated:  Return type of Spatie\Crawler\CrawlObservers\CrawlObserverCollection::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/spatie/crawler/src/CrawlObservers/CrawlObserverCollection.php on line 47
PHP Deprecated:  Return type of Spatie\Crawler\CrawlObservers\CrawlObserverCollection::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/spatie/crawler/src/CrawlObservers/CrawlObserverCollection.php on line 76
PHP Deprecated:  Return type of Spatie\Crawler\CrawlObservers\CrawlObserverCollection::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/spatie/crawler/src/CrawlObservers/CrawlObserverCollection.php on line 81
PHP Deprecated:  Return type of Spatie\Crawler\CrawlObservers\CrawlObserverCollection::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/spatie/crawler/src/CrawlObservers/CrawlObserverCollection.php on line 86
PHP Deprecated:  Return type of Spatie\Crawler\CrawlObservers\CrawlObserverCollection::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/spatie/crawler/src/CrawlObservers/CrawlObserverCollection.php on line 91

Regards.