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 on v1.5.4 #54

Closed squaredpx closed 1 year ago

squaredpx commented 1 year ago

I'm seeing a PHP deprecation notice on the latest plugin version after updating PHP to 8.1.

When the plugin is active this deprecation notice show up on every page load:

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 ..plugins/spatie-ray/vendor/ramsey/uuid/src/Uuid.php on line 159

An these ones only when there is a call to the ray() function:

Deprecated: Return type of Spatie\WordPressRay\Symfony\Component\VarDumper\Cloner\Data::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ..plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/Data.php on line 133

Deprecated: Return type of Spatie\WordPressRay\Symfony\Component\VarDumper\Cloner\Data::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ..plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/Data.php on line 137

Deprecated: Return type of Spatie\WordPressRay\Symfony\Component\VarDumper\Cloner\Data::offsetSet($key, $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 ..plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/Data.php on line 141

Deprecated: Return type of Spatie\WordPressRay\Symfony\Component\VarDumper\Cloner\Data::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ..plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/Data.php on line 101

Deprecated: Return type of Spatie\WordPressRay\Symfony\Component\VarDumper\Cloner\Data::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ..plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/Data.php on line 108

freekmurze commented 1 year ago

I'm not sure what we can do about this as the notice is triggered in the vendor files generated by scopes.

@jeffreyvr do you have an idea how to avoid these notices?

jeffreyvr commented 1 year ago

@freekmurze I think if you add 8.1 to composer.json and then run the build script, those notices might disappear. PHP Scope seems to support 8.1. Haven't had the time to test it yet.

freekmurze commented 1 year ago

I've bumped the dependencies, ran the build script and tagged a new release. Hopefully that will fix this problem.

TorbenLundsgaard commented 1 year ago

The problem has not been fixed. I thing that you need to require "ramsey/uuid": "3.9.6"

freekmurze commented 1 year ago

Just a tagged a new release 1.5.6

Let me know if that works for you.

TorbenLundsgaard commented 1 year ago

Yes it works.

squaredpx commented 1 year ago

Yes, the notices are gone. Thanks!