Skip to content

Commit f2bbfd3

Browse files
author
ityaozm@gmail.com
committed
refactor(generators): Rename defaultRunningCallback method
- Renamed the defaultRunningCallback method to runningCallback for clarity - Updated references in GithubCopilotCliGenerator and GithubModelsCliGenerator classes to use the new method name - This change improves consistency in naming across the generator classes
1 parent b6c1339 commit f2bbfd3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/Generators/Generator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected function getHelper(string $name): HelperInterface
102102
return $this->helperSet->get($name);
103103
}
104104

105-
protected function defaultRunningCallback(): callable
105+
protected function runningCallback(): callable
106106
{
107107
return function (string $type, string $data): void {
108108
Process::OUT === $type ? $this->output->write($data) : $this->output->write("<fg=red>$data</>");

app/Generators/GithubCopilotCliGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ public function generate(string $prompt): string
2323
[
2424
'command' => $this->ensureWithOptions([$this->config['binary'], 'copilot', 'explain', $prompt]),
2525
] + $this->config['parameters']
26-
)->mustRun($this->defaultRunningCallback())->getOutput();
26+
)->mustRun($this->runningCallback())->getOutput();
2727
}
2828
}

app/Generators/GithubModelsCliGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ public function generate(string $prompt): string
2323
[
2424
'command' => $this->ensureWithOptions([$this->config['binary'], 'models', 'run', $this->config['model'], $prompt]),
2525
] + $this->config['parameters']
26-
)->mustRun($this->defaultRunningCallback())->getOutput();
26+
)->mustRun($this->runningCallback())->getOutput();
2727
}
2828
}

0 commit comments

Comments
 (0)