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

PrivilegeChecker::isAdmin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
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