Skip to content

Commit 12baa45

Browse files
authored
Merge pull request #28 from ibnsultan/v3.x
Registering Commands through Commands::class
2 parents 132633c + 6565df9 commit 12baa45

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

app/console/Commands.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace App\Console;
4+
5+
class Commands
6+
{
7+
/**
8+
* Register commands
9+
*
10+
* @param $console
11+
* @return void
12+
*
13+
*/
14+
public static function register($console): void
15+
{
16+
$console->register([
17+
ExampleCommand::class,
18+
]);
19+
}
20+
}

leaf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ $console = new \Aloe\Console('Leaf MVC', 'v3.5.0');
6060
| Add custom commands
6161
|
6262
*/
63-
$console->register(\App\Console\ExampleCommand::class);
63+
\App\Console\Commands::register($console);
6464

6565
/*
6666
|--------------------------------------------------------------------------

0 commit comments

Comments
 (0)