Apply fixes from StyleCI
This commit is contained in:
committed by
StyleCI Bot
parent
20f46adbc4
commit
9596d88b48
@@ -7,7 +7,6 @@ use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
/**
|
||||
* Class Version
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
class Version extends Command
|
||||
{
|
||||
@@ -15,13 +14,15 @@ class Version extends Command
|
||||
|
||||
/**
|
||||
* Create the version number that gets written out
|
||||
*
|
||||
* @param mixed $cfg
|
||||
*/
|
||||
protected function createVersionNumber($cfg)
|
||||
{
|
||||
exec($cfg['git']['git-local'], $version);
|
||||
$version = substr($version[0], 0, $cfg['build']['length']);
|
||||
|
||||
# prefix with the date in YYMMDD format
|
||||
// prefix with the date in YYMMDD format
|
||||
$date = date('ymd');
|
||||
$version = $date.'-'.$version;
|
||||
|
||||
@@ -30,6 +31,7 @@ class Version extends Command
|
||||
|
||||
/**
|
||||
* Run dev related commands
|
||||
*
|
||||
* @throws \Symfony\Component\Yaml\Exception\ParseException
|
||||
*/
|
||||
public function handle()
|
||||
@@ -37,7 +39,7 @@ class Version extends Command
|
||||
$version_file = config_path('version.yml');
|
||||
$cfg = Yaml::parse(file_get_contents($version_file));
|
||||
|
||||
# Get the current build id
|
||||
// Get the current build id
|
||||
$build_number = $this->createVersionNumber($cfg);
|
||||
$cfg['build']['number'] = $build_number;
|
||||
|
||||
@@ -48,13 +50,13 @@ class Version extends Command
|
||||
file_put_contents($version_file, Yaml::dump($cfg, 4, 2));
|
||||
}
|
||||
|
||||
# Only show the major.minor.patch version
|
||||
// Only show the major.minor.patch version
|
||||
if ($this->option('base-only')) {
|
||||
$version = 'v'.$cfg['current']['major'].'.'
|
||||
.$cfg['current']['minor'].'.'
|
||||
.$cfg['current']['patch'];
|
||||
}
|
||||
|
||||
print $version."\n";
|
||||
echo $version."\n";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user