Skip to content

Fix chunk FilesystemStorage sort callback to return int comparator#451

Merged
bytehead merged 1 commit into1up-lab:mainfrom
lku:fix/php82-uasort-comparator-deprecation
Feb 17, 2026
Merged

Fix chunk FilesystemStorage sort callback to return int comparator#451
bytehead merged 1 commit into1up-lab:mainfrom
lku:fix/php82-uasort-comparator-deprecation

Conversation

@lku
Copy link
Copy Markdown
Contributor

@lku lku commented Feb 17, 2026

Fixes a PHP 8.2+ deprecation warning:

"Deprecated: uasort(): Returning bool from comparison function is deprecated..."

The issue occurred in FilesystemStorage::getChunks(), where the sort callback returned a boolean.
The comparator now returns an integer using the <=> operator, which has been supported since PHP 7.

This change is backward compatible and safe for all PHP versions currently supported in main branch.

Reference:

@bytehead bytehead added the bug label Feb 17, 2026
@bytehead bytehead added this to the 5.x milestone Feb 17, 2026
@bytehead bytehead merged commit 3a3306e into 1up-lab:main Feb 17, 2026
11 checks passed
@bytehead
Copy link
Copy Markdown
Member

Thank you! 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants