1 | <?php |
||
9 | class UseCommand extends Command |
||
10 | { |
||
11 | /** |
||
12 | * The console command name. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $name = 'module:use'; |
||
17 | |||
18 | /** |
||
19 | * The console command description. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $description = 'Use the specified module.'; |
||
24 | |||
25 | /** |
||
26 | * Execute the console command. |
||
27 | */ |
||
28 | public function handle() |
||
29 | { |
||
30 | $module = Str::studly($this->argument('module')); |
||
|
|||
31 | |||
32 | if (!$this->laravel['modules']->has($module)) { |
||
33 | $this->error("Module [{$module}] does not exists."); |
||
34 | |||
35 | return; |
||
36 | } |
||
37 | |||
38 | $this->laravel['modules']->setUsed($module); |
||
39 | |||
40 | $this->info("Module [{$module}] used successfully."); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Get the console command arguments. |
||
45 | * |
||
46 | * @return array |
||
47 | */ |
||
48 | 56 | protected function getArguments() |
|
54 | } |
||
55 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.