// +---------------------------------------------------------------------- namespace think\console\command; use think\console\Command; use think\console\Input; /** * @mixin Command */ trait CommandCallable { /** * @param class-string $class */ private function callCommand(string $class): Command { return tap(app($class, newInstance: true), function ($command) { $command->setApp($this->app); $command->run(new Input([]), clone $this->output); }); } }