Skip to content

Commit 63a884e

Browse files
committed
Add fix
1 parent 0582087 commit 63a884e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

system/CLI/GeneratorTrait.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,22 +282,21 @@ protected function qualifyClassName(): string
282282
return $namespace . $directoryString . str_replace('/', '\\', $class);
283283
}
284284

285-
/**
286-
* Normalize input classname.
287-
*/
288285
private function normalizeInputClassName(): string
289286
{
290287
// Gets the class name from input.
291288
$class = $this->params[0] ?? CLI::getSegment(2);
292289

293290
if ($class === null && $this->hasClassName) {
294-
// @codeCoverageIgnoreStart
295-
$nameLang = $this->classNameLang !== ''
291+
$nameField = $this->classNameLang !== ''
296292
? $this->classNameLang
297293
: 'CLI.generator.className.default';
298-
$class = CLI::prompt(lang($nameLang), null, 'required');
294+
$class = CLI::prompt(lang($nameField), null, 'required');
295+
296+
// Reassign the class name to the params array in case
297+
// the class name is requested again
298+
$this->params[0] = $class;
299299
CLI::newLine();
300-
// @codeCoverageIgnoreEnd
301300
}
302301

303302
helper('inflector');

0 commit comments

Comments
 (0)