Passed
Push — master ( f4f5f5...69e5ba )
by Caen
02:58 queued 12s
created

AsksToRebuildSite   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 9
c 1
b 0
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A askToRebuildSite() 0 12 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\Console\Concerns;
6
7
use Illuminate\Support\Facades\Artisan;
8
9
trait AsksToRebuildSite
10
{
11
    protected function askToRebuildSite(): void
12
    {
13
        if ($this->option('no-interaction')) {
0 ignored issues
show
Bug introduced by
It seems like option() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

13
        if ($this->/** @scrutinizer ignore-call */ option('no-interaction')) {
Loading history...
14
            return;
15
        }
16
17
        if ($this->confirm('Would you like to rebuild the site?', 'Yes')) {
0 ignored issues
show
Bug introduced by
It seems like confirm() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

17
        if ($this->/** @scrutinizer ignore-call */ confirm('Would you like to rebuild the site?', 'Yes')) {
Loading history...
18
            $this->line('Okay, building site!');
0 ignored issues
show
Bug introduced by
It seems like line() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

18
            $this->/** @scrutinizer ignore-call */ 
19
                   line('Okay, building site!');
Loading history...
19
            Artisan::call('build');
20
            $this->info('Site is built!');
0 ignored issues
show
Bug introduced by
It seems like info() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

20
            $this->/** @scrutinizer ignore-call */ 
21
                   info('Site is built!');
Loading history...
21
        } else {
22
            $this->line('Okay, you can always run the build later!');
23
        }
24
    }
25
}
26