UserPolicy::destroy()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 2
nc 2
nop 2
crap 2
1
<?php
2
3
namespace App\Policies;
4
5
use App\Models\User;
6
7
class UserPolicy
8
{
9 2
    public function destroy(User $currentUser, User $userToDestroy): bool
10
    {
11 2
        return $currentUser->is_admin && $currentUser->id !== $userToDestroy->id;
12
    }
13
}
14