Skip to content

Conversation

@BrianHenryIE
Copy link
Contributor

@BrianHenryIE BrianHenryIE commented Dec 14, 2025

PHP Deprecated: StephenHill\Base58::__construct(): Implicitly marking parameter $service as nullable is deprecated, the explicit nullable type must be used instead in /path/to/vendor/stephenhill/base58/src/Base58.php on line 29

composer require stephenhill/base58:"^1.1|^2"

Tests pass.

@sisou
Copy link
Member

sisou commented Dec 14, 2025

Hi @BrianHenryIE,

thank you very much for this maintenance fix!

I'm pretty out of PHP development nowadays, so if you could answer me this question: As I understand it, you now allowed two major versions of the base58 dependency. Why not upgrade to version 2 completely?

Thanks for clarifying this for me 🙏

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request improves PHP 8.4 compatibility by updating the stephenhill/base58 dependency to allow both version 1.x and 2.x. The change addresses a deprecation warning in PHP 8.4 regarding implicitly nullable parameters in the Base58 library constructor.

Key changes:

  • Updated stephenhill/base58 version constraint from ^1.1 to ^1.1|^2 to allow version 2.x
  • Updated composer.lock file with new content hash and minor metadata updates (plugin API version, stability flags format)

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
composer.json Updated stephenhill/base58 dependency constraint to allow both v1.1+ and v2.x
composer.lock Regenerated lock file with updated content hash and Composer metadata (still locked to v1.1.5)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@BrianHenryIE
Copy link
Contributor Author

Briefly: it works!

But if you were to require only stephenhill/base58 2.x, it requires PHP 8.1, so then this package would need to update its own minimum PHP version requirement to PHP 8.1.

Your package uses two relevant functions: Base58::encode() and Base58::decode() (unsurprisingly!).

existing updated
1.1.0 Base58::encode() 2.0.0 Base58::encode()
1.1.0 Base58::decode() 2.0.0 Base58::decode()

From the perspective of this project consuming that package, there's no change. It's string in, string out in all cases. So there's no code change required on this side.

The code in this package does not itself require PHP 8.1/+. I would allow both stephenhill/base58 version for the wider compatibility. Another concern if you were to make a breaking change: if someone were to report a bug and they are still using PHP 7.x, then you'd have both the 1.x and 2.x releases to update.

FYI: I'm forever working on: BrianHenryIE/bh-wp-bitcoin-gateway WordPress plugin. It was working three years ago and since then it's been a construction site! Thanks for this library. I hope that's clearly written, I'm a little sick (a mild cough, it'll be gone soon).

BrianHenryIE and others added 2 commits December 17, 2025 08:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sisou sisou force-pushed the composer-require-stephenhill/base58-1.1-2- branch from 0589d75 to 750bdcb Compare December 17, 2025 07:58
@sisou
Copy link
Member

sisou commented Dec 17, 2025

Rebased for merging.

@sisou
Copy link
Member

sisou commented Dec 17, 2025

Thank you very much for the explainer, @BrianHenryIE! Especially the part about v2 requiring PHP 8.1 👍

@sisou sisou merged commit 4acc463 into nimiq:master Dec 17, 2025
@sisou
Copy link
Member

sisou commented Dec 17, 2025

Published as v1.4.2.

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.

2 participants