Test Failed
Branch feature__set_up_scrutinizer (ea6624)
by Robin
06:04 queued 02:46
created

PhpDefault   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 11
dl 0
loc 35
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 14 2
1
<?php
2
3
namespace App\Commands\Php;
4
5
use App\Commands\BaseCommand;
6
use App\Models\PhpVersion;
7
8
class PhpDefault extends BaseCommand
9
{
10
    /**
11
     * The signature of the command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'php:default';
16
17
    /**
18
     * The description of the command.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Set the default PHP version';
23
24
    /**
25
     * Execute the console command.
26
     *
27
     * @return void
28
     */
29
    public function handle(): void
30
    {
31
        $option = $this->menu(
0 ignored issues
show
Bug introduced by
The method menu() does not exist on App\Commands\Php\PhpDefault. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

31
        $option = $this->/** @scrutinizer ignore-call */ menu(
Loading history...
32
            'Available PHP versions',
33
            PhpVersion::pluck('version_number', 'id')->toArray()
34
        )->open();
35
36
        if (! $option) {
37
            return;
38
        }
39
40
        PhpVersion::setDefaultVersion($option);
41
42
        $this->call('make-files');
43
    }
44
}
45