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

PhpDefault::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 14
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 6
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