public static withExecutionContext ( Symfony\Component\Process\PhpExecutableFinder $phpExecutableFinder, PhpSpec\Process\Context\ExecutionContext $executionContext ) : static | ||
$phpExecutableFinder | Symfony\Component\Process\PhpExecutableFinder | |
$executionContext | PhpSpec\Process\Context\ExecutionContext | |
return | static |
public static function withExecutionContext(PhpExecutableFinder $phpExecutableFinder, ExecutionContext $executionContext)
{
$reRunner = new static($phpExecutableFinder);
$reRunner->executionContext = $executionContext;
return $reRunner;
}
/** * @param ServiceContainer $container */ private function setupRerunner(ServiceContainer $container) { $container->setShared('process.rerunner', function (ServiceContainer $c) { return new ReRunner\OptionalReRunner($c->get('process.rerunner.platformspecific'), $c->get('console.io')); }); if ($container->isDefined('process.rerunner.platformspecific')) { return; } $container->setShared('process.rerunner.platformspecific', function (ServiceContainer $c) { return new ReRunner\CompositeReRunner($c->getByPrefix('process.rerunner.platformspecific')); }); $container->setShared('process.rerunner.platformspecific.pcntl', function (ServiceContainer $c) { return ReRunner\PcntlReRunner::withExecutionContext($c->get('process.phpexecutablefinder'), $c->get('process.executioncontext')); }); $container->setShared('process.rerunner.platformspecific.passthru', function (ServiceContainer $c) { return ReRunner\PassthruReRunner::withExecutionContext($c->get('process.phpexecutablefinder'), $c->get('process.executioncontext')); }); $container->setShared('process.rerunner.platformspecific.windowspassthru', function (ServiceContainer $c) { return ReRunner\WindowsPassthruReRunner::withExecutionContext($c->get('process.phpexecutablefinder'), $c->get('process.executioncontext')); }); $container->setShared('process.phpexecutablefinder', function () { return new PhpExecutableFinder(); }); }