Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Oct 19, 2024
1 parent 41fa854 commit 238324a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
17 changes: 9 additions & 8 deletions recipe/provision.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
require __DIR__ . '/provision/website.php';

use Deployer\Task\Context;

use function Deployer\Support\parse_home_dir;

add('recipes', ['provision']);
Expand Down Expand Up @@ -102,14 +103,14 @@
}

if ($showCode) {
$code = "\n\n<comment>====== Configuration Start ======</comment>";
$code .= "\nhost(<info>'{{alias}}'</info>)";
foreach (array_merge($params, $dbparams) as $name) {
$code .= "\n ->set(<info>'$name'</info>, <info>'" . get($name) . "'</info>)";
}
$code .= ";\n";
$code .= "<comment>====== Configuration End ======</comment>\n\n";
writeln($code);
$code = "\n\n<comment>====== Configuration Start ======</comment>";
$code .= "\nhost(<info>'{{alias}}'</info>)";
foreach (array_merge($params, $dbparams) as $name) {
$code .= "\n ->set(<info>'$name'</info>, <info>'" . get($name) . "'</info>)";
}
$code .= ";\n";
$code .= "<comment>====== Configuration End ======</comment>\n\n";
writeln($code);
}
});

Expand Down
5 changes: 2 additions & 3 deletions recipe/provision/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Deployer;


use function Deployer\Support\parse_home_dir;

set('sudo_password', function () {
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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
Expand Down
6 changes: 0 additions & 6 deletions tests/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 238324a

Please sign in to comment.