diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 3b55d7a0..ac499c96 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -2532,7 +2532,7 @@ class SSH2 * @psalm-return ($callback is callable ? bool : string|bool) * @throws \RuntimeException on connection error */ - public function exec(string $command, callable $callback = null) + public function exec(string $command, $callback = null) { $this->curTimeout = $this->timeout; $this->is_timeout = false; @@ -2623,7 +2623,7 @@ class SSH2 $this->channel_status[self::CHANNEL_EXEC] = MessageType::CHANNEL_DATA; - if ($callback === null || $this->in_request_pty_exec) { + if ($callback === false || $this->in_request_pty_exec) { return true; }