Test Failed
Push — master ( ebdfad...c39478 )
by Gianluca
07:20
created

DeletePublicShopFile   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 11
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 15 3
1
<?php
2
3
namespace Mongi\Mongicommerce\Console;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Support\Facades\File;
7
8
class DeletePublicShopFile extends Command
9
{
10
    protected $signature = 'mongicommerce:deleteshop';
11
12
    protected $description = 'Delete shop files [PAY ATTENTION]';
13
14
    public function handle()
15
    {
16
        $this->alert('deleting...');
17
        $this->alert('delete Mongicommerce ASSETS file...');
18
19
        if (file_exists(public_path('/mongicommerce/template/shop'))) {
20
            File::deleteDirectory(public_path('/mongicommerce/template/shop'));
21
        }
22
23
        $this->alert('Assets shop deleted successfully!');
24
25
        if (file_exists(resource_path('/views/mongicommerce'))) {
26
            File::deleteDirectory(resource_path('/views/mongicommerce'));
27
        }
28
        $this->alert('Views shop deleted successfully');
29
    }
30
}
31