booboo icon indicating copy to clipboard operation
booboo copied to clipboard

Fix deprecated warnings for Interfaces in FrameCollection class

Open lukewatts opened this issue 2 years ago • 1 comments

Problem

There are 7 deprecation warnings presented by the package when composer is first run, and also when the HtmlFormatter are used with E_NOTICE turned on.

These warning prevent composer from installing/updating packages in development environments with strict levels of error reporting/handling

Solution

These are all fixed by simply adding the return types for the interface methods (e.g. ArrayAccess::offsetSet(): void)

Log output of errors

Deprecated: Return type of League\BooBoo\Util\FrameCollection::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 C:\laragon\www\thephpleague\booboo\src\Util\FrameCollection.php on line 64

Deprecated: Return type of League\BooBoo\Util\FrameCollection::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 C:\laragon\www\thephpleague\booboo\src\Util\FrameCollection.php on line 73

Deprecated: Return type of League\BooBoo\Util\FrameCollection::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 C:\laragon\www\thephpleague\booboo\src\Util\FrameCollection.php on line 82

Deprecated: Return type of League\BooBoo\Util\FrameCollection::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 C:\laragon\www\thephpleague\booboo\src\Util\FrameCollection.php on line 91

Deprecated: Return type of League\BooBoo\Util\FrameCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\laragon\www\thephpleague\booboo\src\Util\FrameCollection.php on line 
55

Deprecated: Return type of League\BooBoo\Util\FrameCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\laragon\www\thephpleague\booboo\src\Util\FrameCollection.php on line 100

Deprecated: League\BooBoo\Util\Frame implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in C:\laragon\www\thephpleague\booboo\src\Util\Frame.php on line 12

Thanks

lukewatts avatar May 24 '22 09:05 lukewatts

I'm working on a PR for this. Will have it done shortly

lukewatts avatar May 24 '22 09:05 lukewatts