for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link https://github.com/vuongxuongminh/yii2-async
* @copyright Copyright (c) 2019 Vuong Xuong Minh
* @license [New BSD License](http://www.opensource.org/licenses/bsd-license.php)
*/
namespace vxm\async\runtime;
use Spatie\Async\Pool;
use Spatie\Async\Process\ParallelProcess;
use Spatie\Async\Process\Runnable;
use Spatie\Async\Process\SynchronousProcess;
use Spatie\Async\Runtime\ParentRuntime as BaseParentRuntime;
use Symfony\Component\Process\Process;
* ParentRuntime support invoke yii app in child runtime mode.
*
* @author Vuong Minh <[email protected]>
* @since 1.0.0
class ParentRuntime extends BaseParentRuntime
{
* @inheritDoc
public static function createProcess($task): Runnable
if (!self::$isInitialised) {
self::init();
}
list($task, $appConfigFile) = $task;
if (!Pool::isSupported()) {
return SynchronousProcess::create($task, self::getId());
$process = new Process(implode(' ', [
implode(' ', array('exec...task), $appConfigFile))
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);
'exec php',
self::$childProcessScript,
self::$autoloader,
self::encodeTask($task),
$appConfigFile
]));
return ParallelProcess::create($process, self::getId());
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: