spatie / wordpress-ray

Debug with Ray to fix problems faster in WordPress apps
https://myray.app
MIT License
73 stars 14 forks source link

PHP 8.1 deprecation notice #49

Closed slaFFik closed 2 years ago

slaFFik commented 2 years ago
  1. Switch to PHP 8.1.
  2. Install WordPress 5.9.
  3. Activate the latest available Spatie Ray WordPress plugin (1.5.1).

Note the record in the error log:

Deprecated: Return type of Spatie\WordPressRay\Ramsey\Uuid\Uuid::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ...\wp-content\plugins\spatie-ray\vendor\ramsey\uuid\src\Uuid.php on line 159
freekmurze commented 2 years ago

Unfortunately I'm not able to build a new version of Ray right now.

build.sh is generating this error

Fatal error: During inheritance of IteratorAggregate: Uncaught ErrorException: Return type of Humbug\PhpScoper\PhpParser\NodeVisitor\NamespaceStmt\NamespaceStmtCollection::getIterator(): iterable should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/freek/dev/code/wordpress-ray/vendor-bin/php-scoper/vendor/humbug/php-scoper/src/PhpParser/NodeVisitor/NamespaceStmt/NamespaceStmtCollection.php:108

@jeffreyvr do you perhaps now how to solve that one?

jeffreyvr commented 2 years ago

@freekmurze Looks like a PHP 8.1 issue with PHP Scoper. I have created an issue at the PHP-Scoper repo.

jeffreyvr commented 2 years ago

@freekmurze PHP-Scoper has been updated so you should be able to run the build script again. :)

freekmurze commented 2 years ago

@jeffreyvr Thanks for the assist. The build script ran fine again indeed!

@slaFFik The latest version should work in PHP 8.1