Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
Apply fixes from StyleCI (#5)
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
Warrick Bayman authored Mar 13, 2020
1 parent e336677 commit 8a63031
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 22 deletions.
1 change: 0 additions & 1 deletion src/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use TPG\Attache\ConfigurationProvider;

trait Command
Expand Down
3 changes: 0 additions & 3 deletions src/Console/DeployCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Process\Process;
use TPG\Attache\Deployer;
use TPG\Attache\Exceptions\ConfigurationException;
use TPG\Attache\Server;
use TPG\Attache\Ssh;
use TPG\Attache\Task;

/**
* Class DeployCommand.
Expand Down
7 changes: 4 additions & 3 deletions src/Console/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ protected function fire(): int
);

$this->output->writeln('Attaché initialized. Config file at <info>'.$filename.'</info>');

return 0;
}

protected function getGitRemote(): string
{
if (!file_exists('.git/config')) {
if (! file_exists('.git/config')) {
$this->output->writeln('<error>Not a Git repository</error>');
exit(1);
}
Expand Down Expand Up @@ -87,8 +88,8 @@ protected function getConfig(string $remote): array
'user' => 'user',
'root' => '/path/to/application',
'branch' => 'master',
]
]
],
],
];
}
}
4 changes: 1 addition & 3 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
namespace TPG\Attache\Console;

use Symfony\Component\Console\Command\Command as SymfonyCommand;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Question\Question;
use TPG\Attache\Deployer;
use TPG\Attache\ReleaseService;

Expand Down Expand Up @@ -43,7 +41,7 @@ protected function fire(): int

$envFile = $this->option('env');

if ($envFile && !file_exists($envFile)) {
if ($envFile && ! file_exists($envFile)) {
$this->output->writeln('<error>'.$envFile.' does not exist.');
exit(1);
}
Expand Down
18 changes: 8 additions & 10 deletions src/Deployer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
use Symfony\Component\Process\Process;

/**
* Class Deployer
* @package TPG\Attache
* Class Deployer.
*/
class Deployer
{
Expand Down Expand Up @@ -119,7 +118,7 @@ protected function getTasks(Server $server, string $releaseId, bool $install = f
}

/**
* The build task
* The build task.
*
* @return Task
*/
Expand All @@ -131,7 +130,7 @@ protected function buildTask(): Task
}

/**
* The deployment task
* The deployment task.
*
* @param Server $server
* @param string $releaseId
Expand Down Expand Up @@ -167,7 +166,7 @@ protected function DeploymentTask(Server $server, string $releaseId, $migrate =
protected function cloneSteps(Server $server, string $releasePath): array
{
return [
'git clone -b '.$server->branch().' --depth=1 '.$this->config->repository().' '.$releasePath
'git clone -b '.$server->branch().' --depth=1 '.$this->config->repository().' '.$releasePath,
];
}

Expand All @@ -182,7 +181,7 @@ protected function composerSteps(Server $server, string $releasePath): array
{
return [
'cd '.$releasePath.PHP_EOL
.'composer install --no-dev'
.'composer install --no-dev',
];
}

Expand All @@ -196,13 +195,12 @@ protected function composerSteps(Server $server, string $releasePath): array
*/
protected function installationSteps(bool $install, Server $server, string $releasePath): array
{

return $install
? [
'mv '.$releasePath.'/storage '.$server->path('storage'),
]
: [
'rm -rf '.$releasePath.'/storage'
'rm -rf '.$releasePath.'/storage',
];
}

Expand All @@ -220,7 +218,7 @@ protected function envSteps(Server $server, string $releasePath): array
}

/**
* The symbolic link steps
* The symbolic link steps.
*
* @param Server $server
* @param string $releasePath
Expand All @@ -246,7 +244,7 @@ protected function symlinkSteps(Server $server, string $releasePath): array
protected function migrationSteps(bool $migrate, Server $server, string $releasePath): array
{
return [
$migrate ? 'php artisan migrate --force' : null
$migrate ? 'php artisan migrate --force' : null,
];
}

Expand Down
3 changes: 1 addition & 2 deletions src/ReleaseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function getReleasesFromOutput(string $output): array
{
return array_filter(
explode(PHP_EOL, $output),
fn ($release) => $release !== '' && !Str::contains(strtolower($release), 'no such file or directory')
fn ($release) => $release !== '' && ! Str::contains(strtolower($release), 'no such file or directory')
);
}

Expand Down Expand Up @@ -106,7 +106,6 @@ public function activate(string $id): void

public function installed(): bool
{

}

public function delete(array $ids): void
Expand Down

0 comments on commit 8a63031

Please sign in to comment.