Corrected code-smell and code style issues in \ncc\Classes > GitClient
This commit is contained in:
parent
393078cd9e
commit
d4709443f7
2 changed files with 15 additions and 2 deletions
|
@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Corrected code-smell and code style issues in `\ncc\Classes > HttpClient`
|
- Corrected code-smell and code style issues in `\ncc\Classes > HttpClient`
|
||||||
|
- Corrected code-smell and code style issues in `\ncc\Classes > GitClient`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,11 +48,19 @@ namespace ncc\Classes;
|
||||||
$process->setTimeout(3600); // 1 hour
|
$process->setTimeout(3600); // 1 hour
|
||||||
$process->run(function ($type, $buffer)
|
$process->run(function ($type, $buffer)
|
||||||
{
|
{
|
||||||
Console::outVerbose($buffer);
|
if(Process::ERR === $type)
|
||||||
|
{
|
||||||
|
Console::outWarning($buffer);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Console::outVerbose($buffer);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!$process->isSuccessful())
|
if (!$process->isSuccessful())
|
||||||
|
{
|
||||||
throw new GitCloneException($process->getErrorOutput());
|
throw new GitCloneException($process->getErrorOutput());
|
||||||
|
}
|
||||||
|
|
||||||
Console::outVerbose('Repository cloned to: ' . $path);
|
Console::outVerbose('Repository cloned to: ' . $path);
|
||||||
|
|
||||||
|
@ -131,7 +139,9 @@ namespace ncc\Classes;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!$process->isSuccessful())
|
if (!$process->isSuccessful())
|
||||||
|
{
|
||||||
throw new GitTagsException($process->getErrorOutput());
|
throw new GitTagsException($process->getErrorOutput());
|
||||||
|
}
|
||||||
|
|
||||||
$process = new Process(['git', '--no-pager', 'tag', '-l'] , $path);
|
$process = new Process(['git', '--no-pager', 'tag', '-l'] , $path);
|
||||||
|
|
||||||
|
@ -141,10 +151,12 @@ namespace ncc\Classes;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!$process->isSuccessful())
|
if (!$process->isSuccessful())
|
||||||
|
{
|
||||||
throw new GitTagsException($process->getErrorOutput());
|
throw new GitTagsException($process->getErrorOutput());
|
||||||
|
}
|
||||||
|
|
||||||
$tags = explode(PHP_EOL, $process->getOutput());
|
$tags = explode(PHP_EOL, $process->getOutput());
|
||||||
$tags = array_filter($tags, function ($tag)
|
$tags = array_filter($tags, static function ($tag)
|
||||||
{
|
{
|
||||||
return !empty($tag);
|
return !empty($tag);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue