Adding composer deps; Better PHPStan support

This commit is contained in:
Pavel Shevaev 2023-10-24 17:07:35 +03:00
parent 19cf44eb3f
commit 2427e5b434
3 changed files with 6 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
tags

View File

@ -5,6 +5,7 @@
"require": { "require": {
"php": ">=7.4", "php": ">=7.4",
"amphp/amp" : "~v2.6.2", "amphp/amp" : "~v2.6.2",
"amphp/process" : "~v1.1.4",
"phpseclib/phpseclib" : "~2.0.30" "phpseclib/phpseclib" : "~2.0.30"
}, },
"autoload": { "autoload": {

View File

@ -1,6 +1,8 @@
<?php <?php
namespace taskman; namespace taskman;
use Exception;
use Amp; use Amp;
use Amp\Process;
use phpseclib\Crypt\RSA; use phpseclib\Crypt\RSA;
use phpseclib\Net\SSH2; use phpseclib\Net\SSH2;
use phpseclib\Net\SCP; use phpseclib\Net\SCP;
@ -146,6 +148,7 @@ function deploy_node_host_exec($decl, $host, SSH2 $ssh, $cmd, &$status, $opts =
return false; return false;
}); });
$status = $ssh->getExitStatus(); $status = $ssh->getExitStatus();
// @phpstan-ignore-next-line
if($res === false) if($res === false)
throw new Exception("Fatal error executing($status): $cmd"); throw new Exception("Fatal error executing($status): $cmd");
if(($opts & DEPLOY_OPT_ERR_OK) == 0 && $status !== 0) if(($opts & DEPLOY_OPT_ERR_OK) == 0 && $status !== 0)