mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-15 11:23:47 +09:00
Updates to vendors etc
This commit is contained in:
@@ -27,7 +27,7 @@ use Symfony\Component\Stopwatch\Stopwatch;
|
||||
*
|
||||
* @author Jules Pietri <jules@heahprod.com>
|
||||
*/
|
||||
final class TraceableCommand extends Command implements SignalableCommandInterface
|
||||
final class TraceableCommand extends Command
|
||||
{
|
||||
public readonly Command $command;
|
||||
public int $exitCode;
|
||||
@@ -45,6 +45,7 @@ final class TraceableCommand extends Command implements SignalableCommandInterfa
|
||||
/** @var array<string, mixed> */
|
||||
public array $interactiveInputs = [];
|
||||
public array $handledSignals = [];
|
||||
public ?array $invokableCommandInfo = null;
|
||||
|
||||
public function __construct(
|
||||
Command $command,
|
||||
@@ -88,15 +89,11 @@ final class TraceableCommand extends Command implements SignalableCommandInterfa
|
||||
|
||||
public function getSubscribedSignals(): array
|
||||
{
|
||||
return $this->command instanceof SignalableCommandInterface ? $this->command->getSubscribedSignals() : [];
|
||||
return $this->command->getSubscribedSignals();
|
||||
}
|
||||
|
||||
public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false
|
||||
{
|
||||
if (!$this->command instanceof SignalableCommandInterface) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$event = $this->stopwatch->start($this->getName().'.handle_signal');
|
||||
|
||||
$exit = $this->command->handleSignal($signal, $previousExitCode);
|
||||
@@ -171,6 +168,18 @@ final class TraceableCommand extends Command implements SignalableCommandInterfa
|
||||
*/
|
||||
public function setCode(callable $code): static
|
||||
{
|
||||
if ($code instanceof InvokableCommand) {
|
||||
$r = new \ReflectionFunction(\Closure::bind(function () {
|
||||
return $this->code;
|
||||
}, $code, InvokableCommand::class)());
|
||||
|
||||
$this->invokableCommandInfo = [
|
||||
'class' => $r->getClosureScopeClass()->name,
|
||||
'file' => $r->getFileName(),
|
||||
'line' => $r->getStartLine(),
|
||||
];
|
||||
}
|
||||
|
||||
$this->command->setCode($code);
|
||||
|
||||
return parent::setCode(function (InputInterface $input, OutputInterface $output) use ($code): int {
|
||||
|
||||
Reference in New Issue
Block a user