Passed
Push — main ( 3d11c7...dcd309 )
by Daniel
14:22
created

PrivilegeChecker   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 9
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A isAdmin() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Uxmp\Core\Component\User;
6
7
use Uxmp\Core\Orm\Model\UserInterface;
8
9
/**
10
 * Checks for specific user privileges
11
 */
12
final class PrivilegeChecker implements PrivilegeCheckerInterface
13
{
14
    /**
15
     * Returns `true` if the user is an admin user
16
     */
17 1
    public function isAdmin(UserInterface $user): bool
18
    {
19
        // @todo replace when privileges are being added
20 1
        return $user->getName() === 'admin';
21
    }
22
}
23