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 deprecation notice in PHP 8.x #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kohenkatz
Copy link

According to the documentation, all versions of PHP support the usort callable parameter returning an integer. While earlier versions silently accepted a boolean, PHP 8.x throws a deprecation notice:

Deprecation Notice: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in C:\Users\MY_USER\AppData\Roaming\Composer\vendor\sllh\composer-versions-check\src\VersionsCheck.php:54

This fix (based on this comment) eliminates this notice.

fixes #74

According to the documentation, all versions of PHP support the `usort` callable parameter returning an `integer`. While earlier versions silently accepted a `boolean`, PHP 8.x throws a deprecation notice:

```
Deprecation Notice: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in C:\Users\MY_USER\AppData\Roaming\Composer\vendor\sllh\composer-versions-check\src\VersionsCheck.php:54
```

This fix (based on [this comment](soullivaneuh#75 (comment))) eliminates this notice.

fixes soullivaneuh#74
Copy link

@eshimischi eshimischi left a comment

Choose a reason for hiding this comment

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

Confirm notice in PHP 8.x

Copy link

@ipeevski ipeevski left a comment

Choose a reason for hiding this comment

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

Looks good to me

@Maxooo
Copy link

Maxooo commented Nov 26, 2021

Everything looks good ! Does anyone with write access can validate it too ? @soullivaneuh @EmanueleMinotto @dereuromark @TomasVotruba
Thank you everybody for the efforts put in this project 🙌

@dereuromark
Copy link
Contributor

I dont have write access^^
But this getting merged would be helpful!

@dereuromark
Copy link
Contributor

Can someone please click on the merge button?
Who is maintaining this repo?

@dereuromark
Copy link
Contributor

This project is clearly completely dead for years.

I created a new fork ( https://github.com/dereuromark/composer-versions-check ).
Let's contribute there with PRs. I already fixed this issue there: dereuromark@bbf1cb5

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.

usort() deprecation (PHP 8.0)
7 participants