Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Fix deprecated warnings for Interfaces in FrameCollection class #55

Open
lukewatts opened this issue May 24, 2022 · 1 comment
Open

Comments

@lukewatts
Copy link

lukewatts commented May 24, 2022

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
Copy link
Author

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

lukewatts added a commit to lukewatts/booboo that referenced this issue May 24, 2022
…eCollection to remove deprecated warnings
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant