diff --git a/src/SshProcessConnector.php b/src/SshProcessConnector.php index 389c687..603746a 100644 --- a/src/SshProcessConnector.php +++ b/src/SshProcessConnector.php @@ -38,8 +38,11 @@ class SshProcessConnector implements ConnectorInterface * @param ?LoopInterface $loop * @throws \InvalidArgumentException */ - public function __construct($uri, LoopInterface $loop = null) - { + public function __construct( + #[\SensitiveParameter] + $uri, + LoopInterface $loop = null + ) { // URI must use optional ssh:// scheme, must contain host and neither pass nor target must start with dash $parts = \parse_url((\strpos($uri, '://') === false ? 'ssh://' : '') . $uri); $pass = isset($parts['pass']) ? \rawurldecode($parts['pass']) : null; diff --git a/src/SshSocksConnector.php b/src/SshSocksConnector.php index 47e6c7c..969c835 100644 --- a/src/SshSocksConnector.php +++ b/src/SshSocksConnector.php @@ -49,8 +49,11 @@ class SshSocksConnector implements ConnectorInterface * @param ?LoopInterface $loop * @throws \InvalidArgumentException */ - public function __construct($uri, LoopInterface $loop = null) - { + public function __construct( + #[\SensitiveParameter] + $uri, + LoopInterface $loop = null + ) { // URI must use optional ssh:// scheme, must contain host and neither pass nor target must start with dash $parts = \parse_url((\strpos($uri, '://') === false ? 'ssh://' : '') . $uri); $pass = isset($parts['pass']) ? \rawurldecode($parts['pass']) : null;