Completed
Branch feature/currentUserRefactoring (c13c1d)
by Schlaefer
04:13
created

Owner   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 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