diff options
| author | Appleman1234 <applemansigloo@gmail.com> | 2022-09-25 13:30:13 +1000 |
|---|---|---|
| committer | Appleman1234 <applemansigloo@gmail.com> | 2022-09-25 13:30:13 +1000 |
| commit | 2c69095a1edf7474073451285238659d0f62ce3f (patch) | |
| tree | 5dee476605402c66dc2853d0836b29f6aedae62b /inc/remote.php | |
| parent | e9a61e2fbbd930eaa80d6a5f33420cedc59d748c (diff) | |
PHP8.1 fixes from Rector
Diffstat (limited to 'inc/remote.php')
| -rw-r--r-- | inc/remote.php | 6 |
1 files changed, 3 insertions, 3 deletions
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': |
