From 2c69095a1edf7474073451285238659d0f62ce3f Mon Sep 17 00:00:00 2001 From: Appleman1234 Date: Sun, 25 Sep 2022 13:30:13 +1000 Subject: PHP8.1 fixes from Rector --- inc/remote.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc/remote.php') diff --git a/inc/remote.php b/inc/remote.php index 6a685e82..3bc0ab2a 100644 --- a/inc/remote.php +++ b/inc/remote.php @@ -12,13 +12,13 @@ class Remote { $this->{$name} = $value; } - $methods = array(); + $methods = []; if (!isset($this->auth['method'])) error('Unspecified authentication method.'); // Connect - $this->connection = ssh2_connect($this->host, isset($this->port) ? $this->port : 22, $methods); + $this->connection = ssh2_connect($this->host, $this->port ?? 22, $methods); switch ($this->auth['method']) { case 'pubkey': @@ -28,7 +28,7 @@ class Remote { if (!isset($this->auth['private'])) error('Private key filename not specified.'); - if (!ssh2_auth_pubkey_file($this->connection, $this->auth['username'], $this->auth['public'], $this->auth['private'], isset($this->auth['passphrase']) ? $this->auth['passphrase']: null)) + if (!ssh2_auth_pubkey_file($this->connection, $this->auth['username'], $this->auth['public'], $this->auth['private'], $this->auth['passphrase'] ?? null)) error('Public key authentication failed.'); break; case 'plain': -- cgit v1.3