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

Fix PHP8 deprecations #67

Merged
merged 2 commits into from
Jun 10, 2022
Merged

Conversation

jaykay-design
Copy link
Contributor

Added the return types for the Iterator overrides

{
return isset($this->items[$this->index]);
}

public function current()
public function current(): mixed
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can use mixed yet as it causes errors in PHP7.x. We might be able to use #[\ReturnTypeWillChange] attribute and no formal return type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that. I've added the attributes and remove the mixed return type.

@dereuromark
Copy link
Contributor

I have similar errors now on my end:

PHP Deprecated:  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 /vendor/markstory/mini-asset/src/AssetCollection.php on line 142
PHP Deprecated:  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 /vendor/markstory/mini-asset/src/AssetCollection.php on line 167
PHP Deprecated:  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 /vendor/markstory/mini-asset/src/AssetCollection.php on line 152
PHP Deprecated:  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 /vendor/markstory/mini-asset/src/AssetCollection.php on line 157
PHP Deprecated:  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 /vendor/markstory/mini-asset/src/AssetCollection.php on line 162
PHP Deprecated:  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 /vendor/markstory/mini-asset/src/AssetCollection.php on line 147

@dereuromark
Copy link
Contributor

Is there any plan on releasing this?
We face this now also in our default env (local dev is now 8.1)

@markstory markstory merged commit d59f254 into markstory:master Jun 10, 2022
@jaykay-design jaykay-design deleted the php8_deprecation branch June 10, 2022 17:27
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

Successfully merging this pull request may close these issues.

3 participants