Updates to vendors etc

This commit is contained in:
Chris Hunt
2025-07-11 15:57:48 +01:00
parent d972cbcd0a
commit 8fb6438254
8043 changed files with 248005 additions and 189479 deletions

View File

@@ -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 {