diff --git a/src/Client/GuzzleTrait.php b/src/Client/GuzzleTrait.php index 96b2e16..1856241 100644 --- a/src/Client/GuzzleTrait.php +++ b/src/Client/GuzzleTrait.php @@ -66,7 +66,7 @@ function ($retries, if ($exception) { return false; } - if ($response && $response instanceof Response && $response->getStatusCode() !== 502) { + if ($response instanceof Response && $response->getStatusCode() !== 502) { return false; } return $retries < $this->maxRetries; diff --git a/src/Command/Accounts/AddCollabToAcctCommand.php b/src/Command/Accounts/AddCollabToAcctCommand.php index 1137910..41f3c3b 100644 --- a/src/Command/Accounts/AddCollabToAcctCommand.php +++ b/src/Command/Accounts/AddCollabToAcctCommand.php @@ -62,7 +62,7 @@ public function execute(InputInterface $input, OutputInterface $output): int return 0; } - private function roleToInt(string $role) + private function roleToInt(string $role) { $role = strtolower($role); switch($role) { @@ -94,6 +94,5 @@ private function roleToInt(string $role) default: return false; } - // return false; } } diff --git a/src/Command/Ares/RedirectsUploadCommand.php b/src/Command/Ares/RedirectsUploadCommand.php index c21a8db..f6d22d4 100644 --- a/src/Command/Ares/RedirectsUploadCommand.php +++ b/src/Command/Ares/RedirectsUploadCommand.php @@ -57,6 +57,7 @@ public function execute(InputInterface $input, OutputInterface $output): int $file = file_get_contents($file); // parse the csv + /** @var array $data */ $data = array_map('str_getcsv', explode("\n", trim($file))); $columns = array_values($data[0]); diff --git a/src/Command/Auth/LoginCommand.php b/src/Command/Auth/LoginCommand.php index 8ec1642..c603c02 100644 --- a/src/Command/Auth/LoginCommand.php +++ b/src/Command/Auth/LoginCommand.php @@ -4,6 +4,7 @@ use Pagely\AtomicClient\Command\Command; use GuzzleHttp\Exception\BadResponseException; use Pagely\AtomicClient\API\AuthApi; +use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -43,6 +44,7 @@ public function execute(InputInterface $input, OutputInterface $output): int $question = new Question('Password: '); $question->setHidden(true); + /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); $password = $helper->ask($input, $output, $question); diff --git a/src/Command/SSL/AppCertUpdateCommand.php b/src/Command/SSL/AppCertUpdateCommand.php index 2b43f16..1437814 100644 --- a/src/Command/SSL/AppCertUpdateCommand.php +++ b/src/Command/SSL/AppCertUpdateCommand.php @@ -18,7 +18,7 @@ public function configure() ->addArgument('certID', InputArgument::REQUIRED, 'Certificate ID') ->addArgument('aliasID', InputArgument::REQUIRED, 'Alias ID') ; - $this->addCertLinkOptions(); + $this->addCertLinkOptions($this); $this->addOauthOptions(); } diff --git a/src/Command/SSL/CertLinkCommand.php b/src/Command/SSL/CertLinkCommand.php index d300195..0ad27eb 100644 --- a/src/Command/SSL/CertLinkCommand.php +++ b/src/Command/SSL/CertLinkCommand.php @@ -18,7 +18,7 @@ public function configure() ->addArgument('certID', InputArgument::REQUIRED, 'Certificate ID') ->addArgument('aliasID', InputArgument::REQUIRED, 'Alias ID') ; - $this->addCertLinkOptions(); + $this->addCertLinkOptions($this); $this->addOauthOptions(); } diff --git a/src/Command/SSL/CertLinkCommandTrait.php b/src/Command/SSL/CertLinkCommandTrait.php index ebd1b28..e833f7e 100644 --- a/src/Command/SSL/CertLinkCommandTrait.php +++ b/src/Command/SSL/CertLinkCommandTrait.php @@ -11,9 +11,8 @@ */ trait CertLinkCommandTrait { - public function addCertLinkOptions() { - /** @var Command $this */ - $this + public function addCertLinkOptions(Command $cmd) { + $cmd ->addOption('hsts', null, InputOption::VALUE_REQUIRED, 'HSTS Cache Length in Seconds') ->addOption('http2', null, InputOption::VALUE_REQUIRED, 'En/Disable HTTP2 protocol (0 or 1)') ->addOption('tlsConfig', null, InputOption::VALUE_REQUIRED, 'Custom TLS configuration')