Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function run($id) |
||
19 | { |
||
20 | $controller = $this->controller; |
||
21 | $client = $this->findByIdOrIdentifier($id); |
||
22 | |||
23 | $clientInfo = implode('-', $client->getPrimaryKey(true)) . ' (' . $client->getIdentifier() . ')'; |
||
|
|||
24 | |||
25 | if ( |
||
26 | $controller->confirm('Are you sure you want to delete Client ' . $clientInfo |
||
27 | . '? This action can not be undone!') |
||
28 | ) { |
||
29 | $client->delete(); |
||
30 | if ($controller->verbose) { |
||
31 | $controller->stdout('Deleted Client ' . $clientInfo . PHP_EOL, Console::FG_GREEN); |
||
32 | } |
||
33 | } |
||
34 | |||
35 | return ExitCode::OK; |
||
36 | } |
||
38 |