for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of SebastianFeldmann\Cli.
*
* (c) Sebastian Feldmann <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SebastianFeldmann\Cli\Processor;
use RuntimeException;
use SebastianFeldmann\Cli\Command\Result;
use SebastianFeldmann\Cli\Processor;
use Symfony\Component\Process\Process;
* Class ProcOpen
* @package SebastianFeldmann\Cli
* @author Sebastian Feldmann <[email protected]>
* @link https://github.com/sebastianfeldmann/cli
* @since Class available since Release 3.2.2
class Symfony implements Processor
{
* Execute the command
* @param string $cmd
* @param int[] $acceptableExitCodes
* @return \SebastianFeldmann\Cli\Command\Result
public function run(string $cmd, array $acceptableExitCodes = [0]) : Result
$process = new Process($cmd);
$cmd
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);
$process->run();
return new Result(
$cmd,
$process->getExitCode(),
$process->getOutput(),
$process->getErrorOutput(),
'',
$acceptableExitCodes
);
}
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: