Completed
Branch feature/currentUserRefactoring (c13c1d)
by Schlaefer
09:08
created

Owner   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 16
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * Saito - The Threaded Web Forum
7
 *
8
 * @copyright Copyright (c) the Saito Project Developers
9
 * @link https://github.com/Schlaefer/Saito
10
 * @license http://opensource.org/licenses/MIT
11
 */
12
13
namespace Saito\User\Permission\Identifier;
14
15
use Saito\User\ForumsUserInterface;
16
use Saito\User\SaitoUser;
17
18
class Owner extends Role
19
{
20
    protected $type = 'owner';
21
22
    /**
23
     * {@inheritDoc}
24
     *
25
     * @param int|ForumsUserInterface $token User to check against
26
     */
27
    public function __construct($token)
28
    {
29
        if (is_int($token)) {
30
            $token = new SaitoUser(['id' => $token]);
31
        }
32
33
        parent::__construct($token);
34
    }
35
}
36