DomainDeleteCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
dl 0
loc 18
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getArguments() 0 4 1
A handle() 0 7 1
1
<?php
2
3
namespace Salah3id\Domains\Commands;
4
5
use Illuminate\Console\Command;
6
use Symfony\Component\Console\Input\InputArgument;
7
8
class DomainDeleteCommand extends Command
9
{
10
    protected $name = 'domain:delete';
11
    protected $description = 'Delete a domain from the application';
12
13
    public function handle(): int
14
    {
15
        $this->laravel['domains']->delete($this->argument('domain'));
16
17
        $this->components->info("Domain {$this->argument('domain')} has been deleted.");
18
19
        return 0;
20
    }
21
22
    protected function getArguments()
23
    {
24
        return [
25
            ['domain', InputArgument::REQUIRED, 'The name of domain to delete.'],
26
        ];
27
    }
28
}
29