DomainDeleteCommand::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 7
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
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