Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated method return types when running on PHP 8.1 #363

Closed
rochamarcelo opened this issue Jun 9, 2022 · 1 comment
Closed

Deprecated method return types when running on PHP 8.1 #363

rochamarcelo opened this issue Jun 9, 2022 · 1 comment

Comments

@rochamarcelo
Copy link

When running an application with PHP 8.1, these deprecation message are shown, since the plugin requires php >=7.2 and mixed type was added only at PHP 8, the best solution is to add the #[\ReturnTypeWillChange] for each method. What do you say?

[Deprecated (8192) ](javascript:void(0);): Return type of MiniAsset\AssetCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [in /app/vendor/markstory/mini-asset/src/AssetCollection.php, line 142]
[Deprecated (8192) ](javascript:void(0);): Return type of MiniAsset\AssetCollection::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [in /app/vendor/markstory/mini-asset/src/AssetCollection.php, line 167]
[Deprecated (8192) ](javascript:void(0);): Return type of MiniAsset\AssetCollection::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [in /app/vendor/markstory/mini-asset/src/AssetCollection.php, line 152]
[Deprecated (8192) ](javascript:void(0);): Return type of MiniAsset\AssetCollection::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [in /app/vendor/markstory/mini-asset/src/AssetCollection.php, line 157]
[Deprecated (8192) ](javascript:void(0);): Return type of MiniAsset\AssetCollection::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [in /app/vendor/markstory/mini-asset/src/AssetCollection.php, line 162]
[Deprecated (8192) ](javascript:void(0);): Return type of MiniAsset\AssetCollection::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [in /app/vendor/markstory/mini-asset/src/AssetCollection.php, line 147]
@markstory
Copy link
Owner

A new version of MiniAsset has been released. The deprecation warnings you were seeing should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants