Corrected code-smell and code style issues in \ncc\Classes > GitClient

This commit is contained in:
Netkas 2023-08-17 14:05:14 -04:00
parent 393078cd9e
commit d4709443f7
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
2 changed files with 15 additions and 2 deletions

View file

@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Corrected code-smell and code style issues in `\ncc\Classes > HttpClient`
- Corrected code-smell and code style issues in `\ncc\Classes > GitClient`

View file

@ -48,11 +48,19 @@ namespace ncc\Classes;
$process->setTimeout(3600); // 1 hour
$process->run(function ($type, $buffer)
{
Console::outVerbose($buffer);
if(Process::ERR === $type)
{
Console::outWarning($buffer);
}
{
Console::outVerbose($buffer);
}
});
if (!$process->isSuccessful())
{
throw new GitCloneException($process->getErrorOutput());
}
Console::outVerbose('Repository cloned to: ' . $path);
@ -131,7 +139,9 @@ namespace ncc\Classes;
});
if (!$process->isSuccessful())
{
throw new GitTagsException($process->getErrorOutput());
}
$process = new Process(['git', '--no-pager', 'tag', '-l'] , $path);
@ -141,10 +151,12 @@ namespace ncc\Classes;
});
if (!$process->isSuccessful())
{
throw new GitTagsException($process->getErrorOutput());
}
$tags = explode(PHP_EOL, $process->getOutput());
$tags = array_filter($tags, function ($tag)
$tags = array_filter($tags, static function ($tag)
{
return !empty($tag);
});