Repository navigation
Improve PHP 8.1+ support by avoiding deprecation when SSH client dies - #50
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The narrow fix handles null exit codes while preserving integer codes, with regression coverage and no identified blocking issues.
No open issues 🎉
What changed in this PR
Prevents PHP 8.1+ deprecation notices when an SSH process exits with a null exit code.
Changes:
- Casts exit codes to integers in both connectors.
- Adds regression tests for connection cancellation and idle-process termination.
| File | Description |
|---|---|
| tests/IntegrationSshSocksConnectorTest.php | Tests termination after a SOCKS connection failure. |
| tests/IntegrationSshProcessConnectorTest.php | Tests pending connection cancellation. |
| src/SshSocksConnector.php | Casts the exception code to an integer. |
| src/SshProcessConnector.php | Casts the exception code to an integer. |
Review effort: Balanced
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changeset improves PHP 8.1+ support by avoiding a deprecation notice when the SSH client process dies. When the
sshprocess is killed by a signal, for example when cancelling a pending connection attempt, its exit code is reported asnull, and passing this as the exception code is deprecated as of PHP 8.1 (2021). This is really only a leftover that wasn't spotted in #32, so the new tests make sure both connectors no longer raise this deprecation looking forward.Builds on top of #32, #48, #8, #11 and #47