Skip to content

Improve PHP 8.1+ support by avoiding deprecation when SSH client dies - #50

Merged
clue merged 1 commit into
clue:1.xfrom
clue-labs:php8.1
Oct 17, 2026
Merged

clue merged 1 commit into
clue:1.xfrom
clue-labs:php8.1

Conversation

@clue

@clue clue commented Oct 17, 2026

Copy link
Copy Markdown
Owner

This changeset improves PHP 8.1+ support by avoiding a deprecation notice when the SSH client process dies. When the ssh process is killed by a signal, for example when cancelling a pending connection attempt, its exit code is reported as null, 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

@clue clue added the new feature New feature or request label Oct 17, 2026
@clue clue added this to the v1.5.0 milestone Oct 17, 2026
@clue
clue requested a balanced review from Copilot October 17, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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

@clue
clue merged commit acd48d8 into clue:1.x Oct 17, 2026
16 checks passed
@clue
clue deleted the php8.1 branch October 17, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants