GenerateKeyCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 15
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LaravelFreelancerNL\LaravelIndexNow\Commands;
6
7
use Illuminate\Console\Command;
8
use LaravelFreelancerNL\LaravelIndexNow\Facades\IndexNow;
9
10
class GenerateKeyCommand extends Command
11
{
12
    public $signature = 'index-now:generate-key';
13
14
    public $description = 'Generate the key and key file required for index submissions.';
15
16 2
    public function handle(): int
17
    {
18 2
        $key = IndexNow::generateKey();
0 ignored issues
show
Bug Best Practice introduced by
The method LaravelFreelancerNL\Lara...IndexNow::generateKey() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        /** @scrutinizer ignore-call */ 
19
        $key = IndexNow::generateKey();
Loading history...
19
20 2
        $this->info('The keyfile was generated. Please add the following key to your .env file:');
21 2
        $this->newLine();
22 2
        $this->info('INDEXNOW_KEY=' . $key);
23
24 2
        return self::SUCCESS;
25
    }
26
}
27