diff --git a/config/laravel-deploy-helper.php b/config/laravel-deploy-helper.php index d618dd7..64e0a72 100644 --- a/config/laravel-deploy-helper.php +++ b/config/laravel-deploy-helper.php @@ -4,7 +4,7 @@ 'stages' => [ 'production' => [ 'git' => [ - 'http' => '' + 'http' => '', ], 'connection' => [ @@ -32,8 +32,8 @@ 'storage', ], 'files' => [ - '.env' - ] + '.env', + ], ], 'config' => [ @@ -43,6 +43,6 @@ ], 'keep' => 4, ], - ] - ] + ], + ], ]; diff --git a/src/Console/Commands/Deploy.php b/src/Console/Commands/Deploy.php index 9d3f954..5f926f5 100644 --- a/src/Console/Commands/Deploy.php +++ b/src/Console/Commands/Deploy.php @@ -45,6 +45,7 @@ public function __construct() * Execute the console command. * * @throws \Exception on failure + * * @return mixed */ public function handle() @@ -54,9 +55,9 @@ public function handle() if ($this->option('stage') === null) { throw new \Exception('The argument "--stage=" is required!', 128); } else { - if (!is_array(config('laravel-deploy-helper.stages.' . $this->option('stage')))) { - throw new \Exception('The stage "' . $this->option('stage') - . '" does not exist!', 128); + if (!is_array(config('laravel-deploy-helper.stages.'.$this->option('stage')))) { + throw new \Exception('The stage "'.$this->option('stage') + .'" does not exist!', 128); } } @@ -65,12 +66,12 @@ public function handle() } if (in_array($this->option('branch'), Git::getBranches()) == false) { - throw new \Exception('The branch "' . $this->option('branch') - . '" does not exists locally? Please `git pull`!', 128); + throw new \Exception('The branch "'.$this->option('branch') + .'" does not exists locally? Please `git pull`!', 128); } // Connecting to remote server - verbose('[' . $this->option('stage') . '] Trying to login into remote SSH'); + verbose('['.$this->option('stage').'] Trying to login into remote SSH'); $ssh = SSH::instance()->into($this->option('stage')); // Check for lockfile @@ -80,22 +81,22 @@ public function handle() } // Trying to read file - verbose('[' . $this->option('stage') . '] Reading config file from remote server'); - $config = $ssh->exists(SSH::home($this->option('stage')) . '/ldh.json'); + verbose('['.$this->option('stage').'] Reading config file from remote server'); + $config = $ssh->exists(SSH::home($this->option('stage')).'/ldh.json'); // Check if config exists if ($config == false) { - error('[' . $this->option('stage') . '] ldh.json does not exists.'); + error('['.$this->option('stage').'] ldh.json does not exists.'); if ($this->confirm('Do you want to initialize LDH here?')) { Deployer::freshInit($ssh, $this->option('stage')); } else { return false; } } else { - verbose('[' . $this->option('stage') . '] Found config. Checking directories.'); - $config = $ssh->getString(SSH::home($this->option('stage')) . '/ldh.json'); + verbose('['.$this->option('stage').'] Found config. Checking directories.'); + $config = $ssh->getString(SSH::home($this->option('stage')).'/ldh.json'); if ($config == false) { - error('[' . $this->option('stage') . '] Config file is empty... Something is wrong.'); + error('['.$this->option('stage').'] Config file is empty... Something is wrong.'); return false; } @@ -106,10 +107,10 @@ public function handle() $this->ldh = Deployer::doDeploy($ssh, $this->option('stage'), $this->option('branch'), $this->ldh); // Write to config - $ssh->putString(SSH::home($this->option('stage')) . '/ldh.json', json_encode($this->ldh)); + $ssh->putString(SSH::home($this->option('stage')).'/ldh.json', json_encode($this->ldh)); // Done - verbose('[' . $this->option('stage') . '] Deploy successfull!'); + verbose('['.$this->option('stage').'] Deploy successfull!'); Locker::unlock($ssh, $this->option('stage')); } } diff --git a/src/Console/Commands/Locktest.php b/src/Console/Commands/Locktest.php index f4c3b04..070bcf2 100644 --- a/src/Console/Commands/Locktest.php +++ b/src/Console/Commands/Locktest.php @@ -35,6 +35,7 @@ public function __construct() * Execute the console command. * * @throws \Exception on failure + * * @return mixed */ public function handle() @@ -45,21 +46,21 @@ public function handle() if ($this->option('stage') === null) { throw new \Exception('The argument "--stage=" is required!', 128); } else { - if (!is_array(config('laravel-deploy-helper.stages.' . $this->option('stage')))) { - throw new \Exception('The stage "' . $this->option('stage') - . '" does not exist!', 128); + if (!is_array(config('laravel-deploy-helper.stages.'.$this->option('stage')))) { + throw new \Exception('The stage "'.$this->option('stage') + .'" does not exist!', 128); } } $stage = $this->option('stage'); // Connecting to remote server - verbose('[' . $this->option('stage') . '] Trying to login into remote SSH'); + verbose('['.$this->option('stage').'] Trying to login into remote SSH'); $ssh = SSH::instance()->into($this->option('stage')); - verbose('Setting lock: ' . (Locker::lock($ssh, $stage) ? 'OK' : 'Error')); - verbose('Getting lock: ' . (Locker::verify($ssh, $stage) ? 'OK' : 'Error')); - verbose('Path to lock: ' . Locker::getLockPath($ssh, $stage)); - verbose('Destroy lock: ' . (Locker::unlock($ssh, $stage) ? 'OK' : 'Error')); + verbose('Setting lock: '.(Locker::lock($ssh, $stage) ? 'OK' : 'Error')); + verbose('Getting lock: '.(Locker::verify($ssh, $stage) ? 'OK' : 'Error')); + verbose('Path to lock: '.Locker::getLockPath($ssh, $stage)); + verbose('Destroy lock: '.(Locker::unlock($ssh, $stage) ? 'OK' : 'Error')); } } diff --git a/src/Console/Commands/Rollback.php b/src/Console/Commands/Rollback.php index fc4340e..25d5f2e 100644 --- a/src/Console/Commands/Rollback.php +++ b/src/Console/Commands/Rollback.php @@ -30,7 +30,6 @@ class Rollback extends Command /** * Create a new command instance. - * */ public function __construct() { @@ -41,6 +40,7 @@ public function __construct() * Execute the console command. * * @throws \Exception on failure + * * @return mixed */ public function handle() @@ -51,14 +51,14 @@ public function handle() if ($this->option('stage') === null) { throw new \Exception('The argument "--stage=" is required!', 128); } else { - if (!is_array(config('laravel-deploy-helper.stages.' . $this->option('stage')))) { - throw new \Exception('The stage "' . $this->option('stage') - . '" does not exist!', 128); + if (!is_array(config('laravel-deploy-helper.stages.'.$this->option('stage')))) { + throw new \Exception('The stage "'.$this->option('stage') + .'" does not exist!', 128); } } // Connecting to remote server - verbose('[' . $this->option('stage') . '] Trying to login into remote SSH'); + verbose('['.$this->option('stage').'] Trying to login into remote SSH'); $ssh = SSH::instance()->into($this->option('stage')); // Check for lockfile @@ -68,18 +68,18 @@ public function handle() } // Trying to read file - verbose('[' . $this->option('stage') . '] Reading config file from remote server'); - $config = $ssh->exists(SSH::home($this->option('stage')) . '/ldh.json'); + verbose('['.$this->option('stage').'] Reading config file from remote server'); + $config = $ssh->exists(SSH::home($this->option('stage')).'/ldh.json'); // Check if config exists if ($config == false) { - error('[' . $this->option('stage') . '] ldh.json does not exists.'); + error('['.$this->option('stage').'] ldh.json does not exists.'); exit(128); } else { - verbose('[' . $this->option('stage') . '] Found config. Checking directories.'); - $config = $ssh->getString(SSH::home($this->option('stage')) . '/ldh.json'); + verbose('['.$this->option('stage').'] Found config. Checking directories.'); + $config = $ssh->getString(SSH::home($this->option('stage')).'/ldh.json'); if ($config == false) { - error('[' . $this->option('stage') . '] Config file is empty... Something is wrong.'); + error('['.$this->option('stage').'] Config file is empty... Something is wrong.'); exit(0); } $this->ldh = json_decode($config, true); @@ -96,8 +96,8 @@ public function handle() } $this->ldh = Deployer::doRollback($ssh, $this->option('stage'), $this->ldh, $dirs); - $ssh->putString(SSH::home($this->option('stage')) . '/ldh.json', json_encode($this->ldh)); - verbose('[' . $this->option('stage') . '] Rolled back!'); + $ssh->putString(SSH::home($this->option('stage')).'/ldh.json', json_encode($this->ldh)); + verbose('['.$this->option('stage').'] Rolled back!'); Locker::unlock($ssh, $this->option('stage')); } } diff --git a/src/Helpers/Command.php b/src/Helpers/Command.php index 8a2d690..7b2926d 100644 --- a/src/Helpers/Command.php +++ b/src/Helpers/Command.php @@ -9,7 +9,7 @@ class Command { /** - * Execute command on CLI + * Execute command on CLI. * * @param string $prefix utility to execute * @param array $args the arguments to give to the prefix @@ -18,8 +18,6 @@ class Command */ protected static function command($prefix, $args) { - - $process = new Process(self::builder($prefix, $args)); $process->run(); diff --git a/src/Helpers/Deployer.php b/src/Helpers/Deployer.php index a9345c2..b841ec8 100644 --- a/src/Helpers/Deployer.php +++ b/src/Helpers/Deployer.php @@ -14,10 +14,10 @@ public static function freshInit(Connection $connection, $stage) { // Init fresh remote repo $connection->define('init', [ - 'cd ' . config('laravel-deploy-helper.stages.' . $stage . '.remote.root'), + 'cd '.config('laravel-deploy-helper.stages.'.$stage.'.remote.root'), 'mkdir releases', 'mkdir shared', - 'touch ldh.json' + 'touch ldh.json', ]); $connection->task('init'); } @@ -34,11 +34,11 @@ public static function doDeploy(Connection $connection, $stage, $branch, $ldh) { // Some stuff that does not change in runtime $releaseName = time(); - $home = config('laravel-deploy-helper.stages.' . $stage . '.remote.root'); - $shared = config('laravel-deploy-helper.stages.' . $stage . '.shared'); - $commands = config('laravel-deploy-helper.stages.' . $stage . '.commands'); - $versions = config('laravel-deploy-helper.stages.' . $stage . '.config.dependencies'); - $keep = config('laravel-deploy-helper.stages.' . $stage . '.config.keep'); + $home = config('laravel-deploy-helper.stages.'.$stage.'.remote.root'); + $shared = config('laravel-deploy-helper.stages.'.$stage.'.shared'); + $commands = config('laravel-deploy-helper.stages.'.$stage.'.commands'); + $versions = config('laravel-deploy-helper.stages.'.$stage.'.config.dependencies'); + $keep = config('laravel-deploy-helper.stages.'.$stage.'.config.keep'); // Check what releases are old and can be removed ksort($ldh); @@ -48,35 +48,35 @@ public static function doDeploy(Connection $connection, $stage, $branch, $ldh) // Check versions // Operators: http://php.net/manual/en/function.version-compare.php - verbose('[' . $stage . '] Checking dependencies. Migth take a minute.'); + verbose('['.$stage.'] Checking dependencies. Migth take a minute.'); foreach ($versions as $app => $version) { SSH::checkAppVersion($connection, $app, $version); } // Define the deploy $connection->define('deploy', [ - 'mkdir ' . $home . '/releases/' . $releaseName, - 'cd ' . $home . '/releases/' . $releaseName, - 'git clone -b ' . $branch . ' ' . config('laravel-deploy-helper.stages.' . $stage . '.git.http') . ' .' + 'mkdir '.$home.'/releases/'.$releaseName, + 'cd '.$home.'/releases/'.$releaseName, + 'git clone -b '.$branch.' '.config('laravel-deploy-helper.stages.'.$stage.'.git.http').' .', ]); // Pre-flight for shared stuff $items['directories'] = []; foreach ($shared['directories'] as $share) { - verbose('[' . $stage . '] About to share direcroty "' . $home . '/current/' . $share . '"'); - $items['directories'][] = '[ -e ' . $home . '/current/' . $share . ' ] && cp -R -p ' . $home . '/current/' - . $share . ' ' . $home . '/shared/' . $share; - $items['directories'][] = '[ -e ' . $home . '/shared/' . $share . ' ] && cp -R -p ' . $home . '/shared/' . - $share . ' ' . $home . '/releases/' . $releaseName; + verbose('['.$stage.'] About to share direcroty "'.$home.'/current/'.$share.'"'); + $items['directories'][] = '[ -e '.$home.'/current/'.$share.' ] && cp -R -p '.$home.'/current/' + .$share.' '.$home.'/shared/'.$share; + $items['directories'][] = '[ -e '.$home.'/shared/'.$share.' ] && cp -R -p '.$home.'/shared/'. + $share.' '.$home.'/releases/'.$releaseName; } // Pre-flight for shared stuff $items['files'] = []; foreach ($shared['files'] as $share) { - verbose('[' . $stage . '] About to share file "' . $home . '/current/' . $share . '"'); - $items['files'][] = '[ -e ' . $home . '/current/' . $share . ' ] && cp -p ' . $home . '/current/' . $share - . ' ' . $home . '/shared/' . $share; - $items['files'][] = '[ -e ' . $home . '/shared/' . $share . ' ] && cp -p ' . $home . '/shared/' . $share . - ' ' . $home . '/releases/' . $releaseName . '/' . $share; + verbose('['.$stage.'] About to share file "'.$home.'/current/'.$share.'"'); + $items['files'][] = '[ -e '.$home.'/current/'.$share.' ] && cp -p '.$home.'/current/'.$share + .' '.$home.'/shared/'.$share; + $items['files'][] = '[ -e '.$home.'/shared/'.$share.' ] && cp -p '.$home.'/shared/'.$share. + ' '.$home.'/releases/'.$releaseName.'/'.$share; } // Define shared files @@ -87,36 +87,36 @@ public static function doDeploy(Connection $connection, $stage, $branch, $ldh) $items = []; foreach ($commands as $command) { - $items[] = 'cd ' . $home . '/releases/' . $releaseName . ' && ' . $command; + $items[] = 'cd '.$home.'/releases/'.$releaseName.' && '.$command; } // Define commands $connection->define('definedCommands', $items); // Define post deploy actions $connection->define('postDeploy', [ - 'ln -sfn ' . $home . '/releases/' . $releaseName . ' ' . $home . '/current', - 'rm -rf ' . $home . '/shared/*' + 'ln -sfn '.$home.'/releases/'.$releaseName.' '.$home.'/current', + 'rm -rf '.$home.'/shared/*', ]); // Remove old deploys $items = []; foreach ($toRemove as $dir => $val) { - $items[] = 'echo "Removing release ' . $dir . '" && rm -rf ' . $home . '/releases/' . $dir; + $items[] = 'echo "Removing release '.$dir.'" && rm -rf '.$home.'/releases/'.$dir; } $connection->define('removeOld', $items); // Execute them! - verbose('[' . $stage . '] Deploying ' . $branch . ' to server'); + verbose('['.$stage.'] Deploying '.$branch.' to server'); $connection->task('deploy'); - verbose('[' . $stage . '] Handling shared files'); + verbose('['.$stage.'] Handling shared files'); $connection->task('getSharedFiles'); - verbose('[' . $stage . '] Handling shared directories'); + verbose('['.$stage.'] Handling shared directories'); $connection->task('getSharedDirectories'); - verbose('[' . $stage . '] Handling commands'); + verbose('['.$stage.'] Handling commands'); $connection->task('definedCommands'); - verbose('[' . $stage . '] Clean up and linking new instance'); + verbose('['.$stage.'] Clean up and linking new instance'); $connection->task('postDeploy'); - verbose('[' . $stage . '] Remove old deploys'); + verbose('['.$stage.'] Remove old deploys'); $connection->task('removeOld'); $ldh[$releaseName] = true; @@ -126,15 +126,15 @@ public static function doDeploy(Connection $connection, $stage, $branch, $ldh) public static function doRollback(Connection $connection, $stage, $ldh, $dirs) { - $home = config('laravel-deploy-helper.stages.' . $stage . '.remote.root'); + $home = config('laravel-deploy-helper.stages.'.$stage.'.remote.root'); // Define post deploy actions $connection->define('preformRollback', [ - 'ln -sfn ' . $home . '/releases/' . $dirs[1] . ' ' . $home . '/current', - 'rm -rf ' . $home . '/releases/' . $dirs[0], + 'ln -sfn '.$home.'/releases/'.$dirs[1].' '.$home.'/current', + 'rm -rf '.$home.'/releases/'.$dirs[0], ]); - verbose("\t" . 'Hold my beer, We\'re rolling back'); + verbose("\t".'Hold my beer, We\'re rolling back'); $connection->task('preformRollback'); unset($dirs[0]); diff --git a/src/Helpers/Git.php b/src/Helpers/Git.php index b26f06e..4f3a35d 100644 --- a/src/Helpers/Git.php +++ b/src/Helpers/Git.php @@ -4,9 +4,8 @@ class Git extends Command { - /** - * Get branches from current git repository + * Get branches from current git repository. * * @return array */ @@ -25,7 +24,7 @@ public static function getBranches() } /** - * Get last commit + * Get last commit. * * @return string */ diff --git a/src/Helpers/Locker.php b/src/Helpers/Locker.php index 62db40a..54c989b 100644 --- a/src/Helpers/Locker.php +++ b/src/Helpers/Locker.php @@ -18,9 +18,9 @@ class Locker */ public static function verify(Connection $ssh, $stage) { - $home = config('laravel-deploy-helper.stages.' . $stage . '.remote.root'); + $home = config('laravel-deploy-helper.stages.'.$stage.'.remote.root'); - if ($ssh->exists($home . Locker::$lockfile)) { + if ($ssh->exists($home.self::$lockfile)) { return true; } @@ -28,7 +28,7 @@ public static function verify(Connection $ssh, $stage) } /** - * Get lockfile path + * Get lockfile path. * * @param Connection $ssh * @param string $stage @@ -37,7 +37,7 @@ public static function verify(Connection $ssh, $stage) */ public static function getLockPath(Connection $ssh, $stage) { - $home = config('laravel-deploy-helper.stages.' . $stage . '.remote.root'); + $home = config('laravel-deploy-helper.stages.'.$stage.'.remote.root'); if (self::verify($ssh, $stage) !== true) { error('Cannot open lockfile. Does not exist or does not have the rights.'); @@ -47,7 +47,7 @@ public static function getLockPath(Connection $ssh, $stage) $line = ''; - $ssh->run(['ls ' . $home . Locker::$lockfile], function ($callback) use (&$line) { + $ssh->run(['ls '.$home.self::$lockfile], function ($callback) use (&$line) { $line = str_replace("\n", '', $callback); }); @@ -55,7 +55,7 @@ public static function getLockPath(Connection $ssh, $stage) } /** - * Put lockfile in system + * Put lockfile in system. * * @param Connection $ssh * @param string $stage @@ -64,7 +64,7 @@ public static function getLockPath(Connection $ssh, $stage) */ public static function lock(Connection $ssh, $stage) { - $home = config('laravel-deploy-helper.stages.' . $stage . '.remote.root'); + $home = config('laravel-deploy-helper.stages.'.$stage.'.remote.root'); if (self::verify($ssh, $stage) === true) { error('Cannot lock deployment. Lockfile already in use!'); @@ -72,13 +72,13 @@ public static function lock(Connection $ssh, $stage) return false; } - $ssh->putString($home . Locker::$lockfile, time()); + $ssh->putString($home.self::$lockfile, time()); return true; } /** - * Destroy lock file + * Destroy lock file. * * @param Connection $ssh * @param string $stage @@ -87,7 +87,7 @@ public static function lock(Connection $ssh, $stage) */ public static function unlock(Connection $ssh, $stage) { - $home = config('laravel-deploy-helper.stages.' . $stage . '.remote.root'); + $home = config('laravel-deploy-helper.stages.'.$stage.'.remote.root'); if (self::verify($ssh, $stage) !== true) { error('Cannot delete lockfile. Does not exist or does not have the rights.'); @@ -95,7 +95,7 @@ public static function unlock(Connection $ssh, $stage) return false; } - $ssh->delete($home . Locker::$lockfile); + $ssh->delete($home.self::$lockfile); return true; } diff --git a/src/Helpers/SSH.php b/src/Helpers/SSH.php index 179ac18..f7161ef 100644 --- a/src/Helpers/SSH.php +++ b/src/Helpers/SSH.php @@ -22,7 +22,7 @@ public static function instance() */ public static function home($stage) { - return config('laravel-deploy-helper.stages.' . $stage . '.remote.root'); + return config('laravel-deploy-helper.stages.'.$stage.'.remote.root'); } public static function checkAppVersion(Connection $connection, $app, $requestedVersion) @@ -33,7 +33,7 @@ public static function checkAppVersion(Connection $connection, $app, $requestedV $operator = isset($match[1]) ? $match[1] : '='; $version = isset($match[2]) ? $match[2] : 0; - /** + /* * Check if PHP Exists on server WITH this version */ if (strtolower($app) == 'php' && $requestedVersion !== true) { @@ -43,7 +43,7 @@ public static function checkAppVersion(Connection $connection, $app, $requestedV }); } - /** + /* * Check if Node exists on server with thuis version */ if ((strtolower($app) == 'node' || strtolower($app) == 'nodejs') && $requestedVersion !== true) { @@ -52,7 +52,7 @@ public static function checkAppVersion(Connection $connection, $app, $requestedV $currVer = $match['version']; }); } - /** + /* * Check if composer exists on server with thuis version */ if (strtolower($app) == 'composer' && $requestedVersion !== true) { @@ -62,13 +62,13 @@ public static function checkAppVersion(Connection $connection, $app, $requestedV }); } - /** + /* * Check if application just exists on server */ if ($requestedVersion === true) { $connection->run(Command::builder($app, []), function ($response) use ($app) { if (stripos($response, 'command not found') !== false) { - throw new \Exception('ERROR: ' . $app . ' is not installed on the server.'); + throw new \Exception('ERROR: '.$app.' is not installed on the server.'); } }); verbose("\t => Checking $app is available"); @@ -76,16 +76,15 @@ public static function checkAppVersion(Connection $connection, $app, $requestedV return true; } - /** + /* * Check if exists */ $connection->run(Command::builder($app, []), function ($response) use ($app) { if (stripos($response, 'command not found') !== false) { - throw new \Exception('ERROR: ' . $app . ' is not installed on the server.'); + throw new \Exception('ERROR: '.$app.' is not installed on the server.'); } }); - verbose("\t => Checking $app version $currVer $operator $version"); return version_compare($currVer, $version, $operator); diff --git a/src/Helpers/helpers.php b/src/Helpers/helpers.php index 70708f8..fe9bd13 100644 --- a/src/Helpers/helpers.php +++ b/src/Helpers/helpers.php @@ -5,7 +5,7 @@ if (!function_exists('verbose')) { /** - * Output to termial + * Output to termial. * * @param $message * @@ -15,13 +15,13 @@ function verbose($message) { $console = new ConsoleOutput(); $console->getFormatter()->setStyle('info', new OutputFormatterStyle('blue', null)); - $console->writeln('' . $message . ''); + $console->writeln(''.$message.''); } } if (!function_exists('error')) { /** - * Output to termial + * Output to termial. * * @param $message * @@ -31,13 +31,13 @@ function error($message) { $console = new ConsoleOutput(); $console->getFormatter()->setStyle('error', new OutputFormatterStyle('white', 'red')); - $console->writeln('' . $message . ''); + $console->writeln(''.$message.''); } } if (!function_exists('cli_header')) { /** - * Output to termial + * Output to termial. * * @param $message * diff --git a/src/LdhServiceProvider.php b/src/LdhServiceProvider.php index 2626b58..4826902 100644 --- a/src/LdhServiceProvider.php +++ b/src/LdhServiceProvider.php @@ -8,9 +8,8 @@ use Illuminate\Support\ServiceProvider as BaseServiceProvider; /** - * Class PackageServiceProvider + * Class PackageServiceProvider. * - * @package Daltcore\LaravelDeployHelper * @see http://laravel.com/docs/master/packages#service-providers * @see http://laravel.com/docs/master/providers */ @@ -20,6 +19,7 @@ class LdhServiceProvider extends BaseServiceProvider * Indicates if loading of the provider is deferred. * * @see http://laravel.com/docs/master/providers#deferred-providers + * * @var bool */ protected $defer = false; @@ -28,6 +28,7 @@ class LdhServiceProvider extends BaseServiceProvider * Register the service provider. * * @see http://laravel.com/docs/master/providers#the-register-method + * * @return void */ public function register() @@ -42,9 +43,10 @@ public function register() } /** - * Application is booting + * Application is booting. * * @see http://laravel.com/docs/master/providers#the-boot-method + * * @return void */ public function boot() @@ -53,9 +55,10 @@ public function boot() } /** - * Register the package configurations + * Register the package configurations. * * @see http://laravel.com/docs/master/packages#configuration + * * @return void */ protected function registerConfigurations() @@ -68,9 +71,8 @@ protected function registerConfigurations() ], 'ldh-config'); } - /** - * Loads a path relative to the package base directory + * Loads a path relative to the package base directory. * * @param string $path * @@ -78,6 +80,6 @@ protected function registerConfigurations() */ protected function packagePath($path = '') { - return sprintf("%s/../%s", __DIR__, $path); + return sprintf('%s/../%s', __DIR__, $path); } } diff --git a/src/Remote/RemoteManager.php b/src/Remote/RemoteManager.php index 0d5279a..37dc6cb 100644 --- a/src/Remote/RemoteManager.php +++ b/src/Remote/RemoteManager.php @@ -164,7 +164,7 @@ protected function getAuth(array $config) */ protected function getConfig($name) { - $config = $this->app['config']['laravel-deploy-helper.stages.' . $name . '.connection']; + $config = $this->app['config']['laravel-deploy-helper.stages.'.$name.'.connection']; if (!is_null($config)) { return $config; @@ -192,7 +192,7 @@ public function getDefaultConnection() */ public function group($name) { - return $this->connection($this->app['config']['remote.groups.' . $name]); + return $this->connection($this->app['config']['remote.groups.'.$name]); } /**