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