Kanboard requires at least PHP 5.6 now

This commit is contained in:
Frédéric Guillot
2017-12-15 11:24:35 -08:00
parent 2c72a283f2
commit a93b8e10f5
360 changed files with 14804 additions and 6773 deletions

View File

@@ -15,7 +15,6 @@ use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
use Symfony\Component\Process\ProcessBuilder;
/**
* The ProcessHelper class provides helpers to run external processes.
@@ -36,7 +35,7 @@ class ProcessHelper extends Helper
*
* @return Process The process that ran
*/
public function run(OutputInterface $output, $cmd, $error = null, $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE)
public function run(OutputInterface $output, $cmd, $error = null, callable $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
@@ -44,9 +43,7 @@ class ProcessHelper extends Helper
$formatter = $this->getHelperSet()->get('debug_formatter');
if (is_array($cmd)) {
$process = ProcessBuilder::create($cmd)->getProcess();
} elseif ($cmd instanceof Process) {
if ($cmd instanceof Process) {
$process = $cmd;
} else {
$process = new Process($cmd);
@@ -92,7 +89,7 @@ class ProcessHelper extends Helper
*
* @see run()
*/
public function mustRun(OutputInterface $output, $cmd, $error = null, $callback = null)
public function mustRun(OutputInterface $output, $cmd, $error = null, callable $callback = null)
{
$process = $this->run($output, $cmd, $error, $callback);
@@ -112,7 +109,7 @@ class ProcessHelper extends Helper
*
* @return callable
*/
public function wrapCallback(OutputInterface $output, Process $process, $callback = null)
public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
@@ -120,10 +117,8 @@ class ProcessHelper extends Helper
$formatter = $this->getHelperSet()->get('debug_formatter');
$that = $this;
return function ($type, $buffer) use ($output, $process, $callback, $formatter, $that) {
$output->write($formatter->progress(spl_object_hash($process), $that->escapeString($buffer), Process::ERR === $type));
return function ($type, $buffer) use ($output, $process, $callback, $formatter) {
$output->write($formatter->progress(spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type));
if (null !== $callback) {
call_user_func($callback, $type, $buffer);
@@ -131,12 +126,7 @@ class ProcessHelper extends Helper
};
}
/**
* This method is public for PHP 5.3 compatibility, it should be private.
*
* @internal
*/
public function escapeString($str)
private function escapeString($str)
{
return str_replace('<', '\\<', $str);
}