Skip to content

Commit b0d8fd8

Browse files
authored
Merge pull request #8109 from kenjis/fix-spark-make-command
fix: change make:command default $group to `App`
2 parents 243a6be + 42d77d6 commit b0d8fd8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

system/Commands/Generators/CommandGenerator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class CommandGenerator extends BaseCommand
6767
protected $options = [
6868
'--command' => 'The command name. Default: "command:name"',
6969
'--type' => 'The command type. Options [basic, generator]. Default: "basic".',
70-
'--group' => 'The command group. Default: [basic -> "CodeIgniter", generator -> "Generators"].',
70+
'--group' => 'The command group. Default: [basic -> "App", generator -> "Generators"].',
7171
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',
7272
'--suffix' => 'Append the component title to the class name (e.g. User => UserCommand).',
7373
'--force' => 'Force overwrite existing file.',
@@ -106,7 +106,7 @@ protected function prepare(string $class): string
106106
}
107107

108108
if (! is_string($group)) {
109-
$group = $type === 'generator' ? 'Generators' : 'CodeIgniter';
109+
$group = $type === 'generator' ? 'Generators' : 'App';
110110
}
111111

112112
return $this->parseTemplate(

tests/system/Commands/CommandGeneratorTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testGenerateCommand(): void
5252
$file = APPPATH . 'Commands/Deliver.php';
5353
$this->assertFileExists($file);
5454
$contents = $this->getFileContents($file);
55-
$this->assertStringContainsString('protected $group = \'CodeIgniter\';', $contents);
55+
$this->assertStringContainsString('protected $group = \'App\';', $contents);
5656
$this->assertStringContainsString('protected $name = \'command:name\';', $contents);
5757
}
5858

@@ -72,7 +72,7 @@ public function testGenerateCommandWithOptionTypeBasic(): void
7272
$file = APPPATH . 'Commands/Deliver.php';
7373
$this->assertFileExists($file);
7474
$contents = $this->getFileContents($file);
75-
$this->assertStringContainsString('protected $group = \'CodeIgniter\';', $contents);
75+
$this->assertStringContainsString('protected $group = \'App\';', $contents);
7676
$this->assertStringContainsString('protected $name = \'command:name\';', $contents);
7777
}
7878

user_guide_src/source/cli/cli_generators.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Argument:
8686
Options:
8787
========
8888
* ``--command``: The command name to run in spark. Defaults to ``command:name``.
89-
* ``--group``: The group/namespace of the command. Defaults to ``CodeIgniter`` for basic commands, and ``Generators`` for generator commands.
89+
* ``--group``: The group/namespace of the command. Defaults to ``App`` for basic commands, and ``Generators`` for generator commands.
9090
* ``--type``: The type of command, whether a ``basic`` command or a ``generator`` command. Defaults to ``basic``.
9191
* ``--namespace``: Set the root namespace. Defaults to value of ``APP_NAMESPACE``.
9292
* ``--suffix``: Append the component suffix to the generated class name.

0 commit comments

Comments
 (0)