diff --git a/system/Commands/Generators/CommandGenerator.php b/system/Commands/Generators/CommandGenerator.php index 7ccae13f7163..55755643e949 100644 --- a/system/Commands/Generators/CommandGenerator.php +++ b/system/Commands/Generators/CommandGenerator.php @@ -67,7 +67,7 @@ class CommandGenerator extends BaseCommand protected $options = [ '--command' => 'The command name. Default: "command:name"', '--type' => 'The command type. Options [basic, generator]. Default: "basic".', - '--group' => 'The command group. Default: [basic -> "CodeIgniter", generator -> "Generators"].', + '--group' => 'The command group. Default: [basic -> "App", generator -> "Generators"].', '--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".', '--suffix' => 'Append the component title to the class name (e.g. User => UserCommand).', '--force' => 'Force overwrite existing file.', @@ -106,7 +106,7 @@ protected function prepare(string $class): string } if (! is_string($group)) { - $group = $type === 'generator' ? 'Generators' : 'CodeIgniter'; + $group = $type === 'generator' ? 'Generators' : 'App'; } return $this->parseTemplate( diff --git a/tests/system/Commands/CommandGeneratorTest.php b/tests/system/Commands/CommandGeneratorTest.php index 64ab5a21d2d9..aabb86f9a843 100644 --- a/tests/system/Commands/CommandGeneratorTest.php +++ b/tests/system/Commands/CommandGeneratorTest.php @@ -52,7 +52,7 @@ public function testGenerateCommand(): void $file = APPPATH . 'Commands/Deliver.php'; $this->assertFileExists($file); $contents = $this->getFileContents($file); - $this->assertStringContainsString('protected $group = \'CodeIgniter\';', $contents); + $this->assertStringContainsString('protected $group = \'App\';', $contents); $this->assertStringContainsString('protected $name = \'command:name\';', $contents); } @@ -72,7 +72,7 @@ public function testGenerateCommandWithOptionTypeBasic(): void $file = APPPATH . 'Commands/Deliver.php'; $this->assertFileExists($file); $contents = $this->getFileContents($file); - $this->assertStringContainsString('protected $group = \'CodeIgniter\';', $contents); + $this->assertStringContainsString('protected $group = \'App\';', $contents); $this->assertStringContainsString('protected $name = \'command:name\';', $contents); } diff --git a/user_guide_src/source/cli/cli_generators.rst b/user_guide_src/source/cli/cli_generators.rst index 8636901644f2..e04772f6ab00 100644 --- a/user_guide_src/source/cli/cli_generators.rst +++ b/user_guide_src/source/cli/cli_generators.rst @@ -86,7 +86,7 @@ Argument: Options: ======== * ``--command``: The command name to run in spark. Defaults to ``command:name``. -* ``--group``: The group/namespace of the command. Defaults to ``CodeIgniter`` for basic commands, and ``Generators`` for generator commands. +* ``--group``: The group/namespace of the command. Defaults to ``App`` for basic commands, and ``Generators`` for generator commands. * ``--type``: The type of command, whether a ``basic`` command or a ``generator`` command. Defaults to ``basic``. * ``--namespace``: Set the root namespace. Defaults to value of ``APP_NAMESPACE``. * ``--suffix``: Append the component suffix to the generated class name.