1 | <?php |
||
2 | |||
3 | namespace App\Console\Commands; |
||
4 | |||
5 | use Blacklight\PopulateAniDB; |
||
6 | use Illuminate\Console\Command; |
||
7 | |||
8 | class NntmuxPopulateAniDB extends Command |
||
9 | { |
||
10 | /** |
||
11 | * The name and signature of the console command. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $signature = 'nntmux:populate-anidb |
||
16 | {--full : Populate full data} |
||
17 | {--info : Populate info only} |
||
18 | {--anidbid : Populate tables for specific anidbid}'; |
||
19 | |||
20 | /** |
||
21 | * The console command description. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $description = 'Populate AniDB table'; |
||
26 | |||
27 | /** |
||
28 | * Execute the console command. |
||
29 | */ |
||
30 | public function handle(): void |
||
31 | { |
||
32 | if ($this->option('full')) { |
||
33 | (new PopulateAniDB(['Echo' => true]))->populateTable('full'); |
||
0 ignored issues
–
show
|
|||
34 | } elseif ($this->option('info') && is_numeric($this->option('anidbid'))) { |
||
35 | (new PopulateAniDB(['Echo' => true]))->populateTable('info', $this->option('anidbid')); |
||
36 | } elseif ($this->option('info')) { |
||
37 | (new PopulateAniDB(['Echo' => true]))->populateTable('info'); |
||
38 | } |
||
39 | $this->info('AniDB tables populated with requested data'); |
||
40 | } |
||
41 | } |
||
42 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.