Issues (65)

tests/example/table.php (1 issue)

Labels
Severity
1
<?php
2
3
/**
4
 * This file is part of graze/parallel-process.
5
 *
6
 * Copyright © 2018 Nature Delivered Ltd. <https://www.graze.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @license https://github.com/graze/parallel-process/blob/master/LICENSE.md
12
 * @link    https://github.com/graze/parallel-process
13
 */
14
15
$composer = require_once __DIR__ . '/../../vendor/autoload.php';
16
$composer->setUseIncludePath(true);
17
18
use Graze\ParallelProcess\Display\Table;
19
use Symfony\Component\Console\Output\ConsoleOutput;
20
use Symfony\Component\Process\Process;
21
22
$output = new ConsoleOutput(ConsoleOutput::VERBOSITY_VERY_VERBOSE);
23
24
$pool = new \Graze\ParallelProcess\PriorityPool();
25
$pool->setMaxSimultaneous(3);
26
for ($i = 0; $i < 5; $i++) {
27
    $time = $i + 5;
28
    $pool->add(new Process(sprintf('for i in `seq 1 %d` ; do date ; sleep 1 ; done', $time)), ['sleep' => $time]);
0 ignored issues
show
sprintf('for i in `seq 1...sleep 1 ; done', $time) of type string is incompatible with the type array expected by parameter $command of Symfony\Component\Process\Process::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

28
    $pool->add(new Process(/** @scrutinizer ignore-type */ sprintf('for i in `seq 1 %d` ; do date ; sleep 1 ; done', $time)), ['sleep' => $time]);
Loading history...
29
}
30
$table = new Table($output, $pool);
31
$table->run();
32