1 <?php
2
3 namespace Skimia\Foundation\Providers\Traits;
4
5 use Illuminate\Support\ServiceProvider;
6
7 trait CommandLoaderTrait
8 {
9 /**
10 * Register the commands.
11 *
12 * @return void
13 */
14 protected function registerCommands()
15 {
16 ensure_trait_used_in_subclass_of_or_fail(self::class, $this, ServiceProvider::class);
17
18 foreach (array_keys($this->commands) as $command) {
19 $method = "register{$command}Command";
20 call_user_func_array([$this, $method], []);
21 }
22 $this->commands(array_values($this->commands));
23 }
24 }
25