diff --git a/recipe/provision.php b/recipe/provision.php index 500eebaed..079f9a96c 100644 --- a/recipe/provision.php +++ b/recipe/provision.php @@ -9,6 +9,7 @@ require __DIR__ . '/provision/website.php'; use Deployer\Task\Context; + use function Deployer\Support\parse_home_dir; add('recipes', ['provision']); @@ -102,14 +103,14 @@ } if ($showCode) { - $code = "\n\n====== Configuration Start ======"; - $code .= "\nhost('{{alias}}')"; - foreach (array_merge($params, $dbparams) as $name) { - $code .= "\n ->set('$name', '" . get($name) . "')"; - } - $code .= ";\n"; - $code .= "====== Configuration End ======\n\n"; - writeln($code); + $code = "\n\n====== Configuration Start ======"; + $code .= "\nhost('{{alias}}')"; + foreach (array_merge($params, $dbparams) as $name) { + $code .= "\n ->set('$name', '" . get($name) . "')"; + } + $code .= ";\n"; + $code .= "====== Configuration End ======\n\n"; + writeln($code); } }); diff --git a/recipe/provision/user.php b/recipe/provision/user.php index 997838953..03896a836 100644 --- a/recipe/provision/user.php +++ b/recipe/provision/user.php @@ -2,7 +2,6 @@ namespace Deployer; - use function Deployer\Support\parse_home_dir; set('sudo_password', function () { @@ -69,10 +68,10 @@ } if (!$publicKeyContent) { - $publicKeyContent = ask(' Public key: ', false); + $publicKeyContent = ask(' Public key: ', ''); } - if (!$publicKeyContent) { + if (empty($publicKeyContent)) { info('Skipping public key copy as no public key was found or provided.'); return; } diff --git a/src/functions.php b/src/functions.php index f95978bc4..93e94395b 100644 --- a/src/functions.php +++ b/src/functions.php @@ -851,7 +851,7 @@ function askHiddenResponse(string $message): string } if (Deployer::isWorker()) { - return (string)Deployer::proxyCallToMaster(currentHost(), __FUNCTION__, ...func_get_args()); + return (string) Deployer::proxyCallToMaster(currentHost(), __FUNCTION__, ...func_get_args()); } /** @var QuestionHelper */ @@ -865,7 +865,7 @@ function askHiddenResponse(string $message): string $question->setHidden(true); $question->setHiddenFallback(false); - return (string)$helper->ask(input(), output(), $question); + return (string) $helper->ask(input(), output(), $question); } function input(): InputInterface diff --git a/tests/phpstan-baseline.neon b/tests/phpstan-baseline.neon index 674386a91..c27920a41 100644 --- a/tests/phpstan-baseline.neon +++ b/tests/phpstan-baseline.neon @@ -34,9 +34,3 @@ parameters: message: "#^Unreachable statement \\- code above always terminates\\.$#" count: 1 path: ../src/Importer/Importer.php - - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: ../src/functions.php -