for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace ReliQArts\Docweaver\Services;
use ReliQArts\Docweaver\Contracts\VCSCommandRunner;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
final class GitCommandRunner implements VCSCommandRunner
{
/**
* @param string $source
* @param string $branch
* @param string $workingDirectory
*/
public function clone(string $source, string $branch, string $workingDirectory): void
$clone = new Process(sprintf('git clone --branch %s "%s" %s', $branch, $source, $branch), $workingDirectory);
sprintf('git clone --bra...anch, $source, $branch)
string
array
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$clone->mustRun();
}
*
* @throws ProcessFailedException
* @return array
public function getTags(string $workingDirectory): array
$listTags = new Process('git tag -l', $workingDirectory);
'git tag -l'
$listTags->mustRun();
if ($splitTags = preg_split("/[\n\r]/", $listTags->getOutput())) {
return array_filter(array_map('trim', $splitTags));
return [];
public function pull(string $workingDirectory): void
$pull = new Process('git pull', $workingDirectory);
'git pull'
$pull->mustRun();
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: