Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
AsksToRebuildSite
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
3
100.00% covered (success)
100.00%
1 / 1
 askToRebuildSite
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
3
1<?php
2
3declare(strict_types=1);
4
5namespace Hyde\Console\Concerns;
6
7use Illuminate\Support\Facades\Artisan;
8
9trait AsksToRebuildSite
10{
11    protected function askToRebuildSite(): void
12    {
13        if ($this->option('no-interaction')) {
14            return;
15        }
16
17        if ($this->confirm('Would you like to rebuild the site?', true)) {
18            $this->line('Okay, building site!');
19            Artisan::call('build');
20            $this->info('Site is built!');
21        } else {
22            $this->line('Okay, you can always run the build later!');
23        }
24    }
25}