@@ -16,7 +16,7 @@ |
||
| 16 | 16 | * |
| 17 | 17 | * @var string |
| 18 | 18 | */ |
| 19 | - private $pty = NULL; |
|
| 19 | + private $pty = null; |
|
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * Environmental variables (associative array). |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | $this->pubkeyfile, |
| 66 | 66 | $this->privkeyfile, |
| 67 | 67 | $this->passphrase |
| 68 | - ) === FALSE) |
|
| 68 | + ) === false) |
|
| 69 | 69 | { |
| 70 | 70 | throw new \RuntimeException('Public key based authentication failed.'); |
| 71 | 71 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $auth = @ssh2_auth_none($resource, $this->username); |
| 38 | 38 | if (is_array($auth)) |
| 39 | 39 | { |
| 40 | - throw new \RuntimeException('Username based authentication failed, supported methods include: ' . implode(', ', $auth)); |
|
| 40 | + throw new \RuntimeException('Username based authentication failed, supported methods include: '.implode(', ', $auth)); |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | final public function authenticate($resource) |
| 45 | 45 | { |
| 46 | - if (@ssh2_auth_password($resource, $this->username, $this->password) === FALSE) |
|
| 46 | + if (@ssh2_auth_password($resource, $this->username, $this->password) === false) |
|
| 47 | 47 | { |
| 48 | 48 | throw new \RuntimeException('Password based authentication failed.'); |
| 49 | 49 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | final public function authenticate($resource) |
| 37 | 37 | { |
| 38 | - if (@ssh2_auth_agent($resource, $this->username) === FALSE) |
|
| 38 | + if (@ssh2_auth_agent($resource, $this->username) === false) |
|
| 39 | 39 | { |
| 40 | 40 | throw new \RuntimeException('Agent based authentication failed.'); |
| 41 | 41 | } |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | final public function get_error_message() |
| 125 | 125 | { |
| 126 | 126 | $this->error_message = error_get_last()['message']; |
| 127 | - return $this->error_message . ' in ' . $this->get_error_file() . ' on line ' . $this->get_error_line(); |
|
| 127 | + return $this->error_message.' in '.$this->get_error_file().' on line '.$this->get_error_line(); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -37,21 +37,21 @@ |
||
| 37 | 37 | * |
| 38 | 38 | * @var string |
| 39 | 39 | */ |
| 40 | - protected $error_message = NULL; |
|
| 40 | + protected $error_message = null; |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Last known error line number. |
| 44 | 44 | * |
| 45 | 45 | * @var int |
| 46 | 46 | */ |
| 47 | - protected $error_line_no = NULL; |
|
| 47 | + protected $error_line_no = null; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Last known error filename. |
| 51 | 51 | * |
| 52 | 52 | * @var string |
| 53 | 53 | */ |
| 54 | - protected $error_file = NULL; |
|
| 54 | + protected $error_file = null; |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Set STDOUT output stream. |
@@ -91,15 +91,15 @@ |
||
| 91 | 91 | * @param instance $terminal Terminal instance |
| 92 | 92 | * @return object |
| 93 | 93 | */ |
| 94 | - final public function write($command, $returncode = FALSE) |
|
| 94 | + final public function write($command, $returncode = false) |
|
| 95 | 95 | { |
| 96 | - $command = ($returncode == FALSE) ? $command : $command.'; echo "RETURN_CODE:[$?]";'; |
|
| 96 | + $command = ($returncode == false) ? $command : $command.'; echo "RETURN_CODE:[$?]";'; |
|
| 97 | 97 | $write_count = 0; |
| 98 | 98 | $string_len = strlen($command.PHP_EOL); |
| 99 | 99 | while ($write_count < $string_len) |
| 100 | 100 | { |
| 101 | 101 | $fwrite_count = fwrite($this->stream, substr($command.PHP_EOL, $write_count), 1024); |
| 102 | - if ($fwrite_count === FALSE) |
|
| 102 | + if ($fwrite_count === false) |
|
| 103 | 103 | { |
| 104 | 104 | throw new \RuntimeException('failed to write command to stream'); |
| 105 | 105 | } |
@@ -49,14 +49,14 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | final public function copy($srcfile, $destfile) |
| 51 | 51 | { |
| 52 | - if ($this->is_file($srcfile) === FALSE) |
|
| 52 | + if ($this->is_file($srcfile) === false) |
|
| 53 | 53 | { |
| 54 | 54 | $this->set_error('Local file '.$srcfile.' does not exist.'); |
| 55 | 55 | $this->set_exitstatus(1); |
| 56 | 56 | return; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if (@copy($this->sftp_url($srcfile), $this->sftp_url($destfile)) === FALSE) |
|
| 59 | + if (@copy($this->sftp_url($srcfile), $this->sftp_url($destfile)) === false) |
|
| 60 | 60 | { |
| 61 | 61 | $this->set_error($this->get_error_message()); |
| 62 | 62 | $this->set_exitstatus(1); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | if (preg_match('/^-.*$/', $key, $matches)) |
| 72 | 72 | { |
| 73 | - $options[] = is_bool($value) ? $key : str_pad($key, strlen($key) + 1, ' ', STR_PAD_RIGHT) . $value; |
|
| 73 | + $options[] = is_bool($value) ? $key : str_pad($key, strlen($key) + 1, ' ', STR_PAD_RIGHT).$value; |
|
| 74 | 74 | } |
| 75 | 75 | if (preg_match('/^-.*$/', $value, $matches)) |
| 76 | 76 | { |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | { |
| 95 | 95 | if (preg_match('/^-.*$/', $key, $matches)) |
| 96 | 96 | { |
| 97 | - $arguments[] = is_bool($value) ? $key : str_pad($key, strlen($key) + 1, ' ', STR_PAD_RIGHT) . $value; |
|
| 97 | + $arguments[] = is_bool($value) ? $key : str_pad($key, strlen($key) + 1, ' ', STR_PAD_RIGHT).$value; |
|
| 98 | 98 | } |
| 99 | 99 | else |
| 100 | 100 | { |
@@ -95,8 +95,7 @@ |
||
| 95 | 95 | if (preg_match('/^-.*$/', $key, $matches)) |
| 96 | 96 | { |
| 97 | 97 | $arguments[] = is_bool($value) ? $key : str_pad($key, strlen($key) + 1, ' ', STR_PAD_RIGHT) . $value; |
| 98 | - } |
|
| 99 | - else |
|
| 98 | + } else |
|
| 100 | 99 | { |
| 101 | 100 | $arguments[] = is_array($value) ? implode(' ', $value) : $value; |
| 102 | 101 | } |