Skip to content

Commit 42d77d6

Browse files
committed
fix: change make:command default $group to App
`CodeIgniter` is already used for the framework commands. CodeIgniter env Retrieves the current environment, or set a new one. filter:check Check filters for a route. help Displays basic usage information. list Lists the available commands. namespaces Verifies your namespaces are setup correctly. publish Discovers and executes all predefined Publisher classes. routes Displays all routes. serve Launches the CodeIgniter PHP-Development Server.
1 parent 8409157 commit 42d77d6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

system/Commands/Generators/CommandGenerator.php

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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)