for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Task\TaskBundle\Executor;
use Symfony\Component\Process\Process;
/**
* Factory for execution-process.
*/
class ExecutionProcessFactory
{
* @var string
private $consolePath;
private $environment;
* @var float|null
private $processTimeout;
* @param string $consolePath
* @param float|null $processTimeout
* @param string $environment
public function __construct($consolePath, $processTimeout, $environment)
$this->consolePath = $consolePath;
$this->processTimeout = $processTimeout;
$this->environment = $environment;
}
* Create process for given execution-uuid.
*
* @param string $uuid
* @return Process
public function create($uuid)
$command = implode(' ', [$this->consolePath, 'task:execute', $uuid, '--env=' . $this->environment]);
if (method_exists(Process::class, 'fromShellCommandline')) {
$process = Process::fromShellCommandline($command);
} else {
$process = new Process($command);
$command
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);
return $process->setTimeout($this->processTimeout);
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: