| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function handle() |
||
| 13 | { |
||
| 14 | $name = $this->argument('name'); |
||
| 15 | |||
| 16 | $host = $this->determineHostModelClass()::where('name', $name)->first(); |
||
|
|
|||
| 17 | |||
| 18 | if (! $host) { |
||
| 19 | return $this->error("Host with name `{$name}` not found."); |
||
| 20 | } |
||
| 21 | |||
| 22 | if (! $this->confirm("Are you sure you wish to delete `{$name}`?")) { |
||
| 23 | return; |
||
| 24 | } |
||
| 25 | |||
| 26 | $host->delete(); |
||
| 27 | |||
| 28 | $this->info("Host `{$name}` was deleted!"); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.