jacksleight / statamic-bard-texstyle

This Statamic addon allows you to add custom element styles to the Bard fieldtype and edit element attributes.
https://statamic.com/addons/jacksleight/bard-texstyle
Other
12 stars 0 forks source link

jsonSerialize return type change warning #51

Closed AntonCooper closed 1 year ago

AntonCooper commented 1 year ago

Bug Description

Getting PHP deprecation warnings due to a change of return type. Return type of JackSleight\StatamicBardTexstyle\TypeManager::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vendor/jacksleight/statamic-bard-texstyle/src/TypeManager.php on line 503

Adding #[\ReturnTypeWillChange] or setting a return type on the method will silence this.

    public function jsonSerialize(): array
    {
        return $this->types;
    }
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
        return $this->types;
    }

How to Reproduce

Install addon, run any code.

Extra Detail

n/a

Environment

Environment
Application Name: ***
Laravel Version: 9.52.7
PHP Version: 8.2.5
Composer Version: 2.5.7
Environment: local
Debug Mode: ENABLED
URL: ***
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: pusher
Cache: redis
Database: mysql
Logs: stack / single
Mail: log
Queue: redis
Session: file

Statamic
Addons: 6
Antlers: runtime
Stache Watcher: Disabled
Static Caching: Disabled
Version: 4.6.0 PRO

Statamic Addons
jacksleight/statamic-bard-mutator: 2.3.0
jacksleight/statamic-bard-texstyle: 3.1.2
mitydigital/feedamic: 2.2.5
statamic/collaboration: 0.6.0
statamic/eloquent-driver: 2.1.0
transformstudios/review: 4.1.0
jacksleight commented 1 year ago

Thanks for the report, fixed in v3.1.3