Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.0312 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
48 | 11 | public function update(User $user, Url $url): bool |
|
49 | { |
||
50 | 11 | if ($user->hasPermissionTo('url:update:any')) { |
|
51 | 4 | return true; |
|
52 | } |
||
53 | |||
54 | 7 | if (! $user->hasPermissionTo('url:update')) { |
|
55 | return true; |
||
56 | } |
||
57 | |||
58 | 7 | if ($user->id === $url->user_id) { |
|
59 | 6 | return true; |
|
60 | } |
||
61 | |||
62 | 2 | return false; |
|
63 | } |
||
82 |