Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Lines | 16 |
Ratio | 100 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
35 | 3 | View Code Duplication | public function make(Permission $permission): bool |
36 | { |
||
37 | 3 | $exists = $this->exists->make($permission); |
|
38 | |||
39 | 3 | if ($exists === false) { |
|
40 | 1 | throw new PermissionDoesNotExistsException; |
|
41 | } |
||
42 | |||
43 | 3 | $attached = $this->attached->make($permission); |
|
44 | |||
45 | 3 | if ($attached === true) { |
|
46 | 1 | throw new PermissionIsAttachedException; |
|
47 | } |
||
48 | |||
49 | 2 | return $this->delete->make($permission); |
|
50 | } |
||
51 | } |
||
52 |