You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bin/src/ControllerCommand.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,8 @@ class ControllerCommand extends Command{
15
15
16
16
protectedfunctionconfigure(){
17
17
$this->setName("make:controller")
18
-
->setDescription("Hashes a given string using Bcrypt")
19
-
->addArgument('controllerName', InputArgument::REQUIRED, 'What is the name of the controller you wish to create? Controller name must be capitalized and Plural with ending with the suffix Controller. eg. PostsController)');
18
+
->setDescription("Creates a controller file in app/Controllers")
19
+
->addArgument('controllerName', InputArgument::REQUIRED, 'What is the name of the controller you wish to create? Controller name must be capitalized and Plural with ending with the suffix Controller. eg. BooksController)');
@@ -28,16 +28,16 @@ protected function execute(InputInterface $input, OutputInterface $output){
28
28
29
29
//confirm that it contains the word controller
30
30
if( strpos( $input, "Controller" ) == false ) {
31
-
$output->writeln('Error: Your controller name is not named correctly. It should be in plural and should end with the word Controller. Eg. PostsController');
31
+
$output->writeln('<error>Error: Your controller name is not named correctly. It should be in plural and should end with the word Controller. Eg. BooksController </error>');
32
32
}elseif($input{0} !== strtoupper($input{0})){
33
33
//the first character does not start with an upper case
34
-
$output->writeln('Error: Your controller name must start with a capital letter eg. PostsController');
34
+
$output->writeln('Error: Your controller name must start with a capital letter eg. BooksController');
35
35
}elseif( strpos( $input, "." ) !== false ) {
36
-
$output->writeln('Error: Your controller name cannot contain a dot. Here is an example of a good controller name : PostsController');
36
+
$output->writeln('<fg=red>Error: Your controller name cannot contain a dot. Here is an example of a good controller name : BooksController </>');
37
37
}else{
38
38
$result = $make->makeController($input);
39
39
40
-
$output->writeln('Your controller has been created in app/Controllers/' . $input.'.php');
40
+
$output->writeln('< fg=green >Your controller has been created in app/Controllers/ </>' . $input.'.php');
0 commit comments