EnforceContext   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
declare(strict_types=1);
4
5
namespace Casbin;
6
7
/**
8
 * Class EnforceContext
9
 * EnforceContext is used as the first element of the parameter "rvals" in method "enforce"
10
 *
11
 * @author [email protected]
0 ignored issues
show
Coding Style introduced by
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
12
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
13
class EnforceContext
14
{
15
    /**
16
     * rType
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
17
     *
18
     * @var string
19
     */
20
    public $rType;
21
    /**
22
     * pType
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
23
     *
24
     * @var string
25
     */
26
    public $pType;
27
    /**
28
     * eType
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
29
     *
30
     * @var string
31
     */
32
    public $eType;
33
    /**
34
     * mType
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
35
     *
36
     * @var string
37
     */
38
    public $mType;
39
40
    /**
41
     * Create a default structure based on the suffix
42
     *
43
     * @param string $suffix
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
44
     */
45 3
    public function __construct(string $suffix)
46
    {
47 3
        $this->rType = "r" . $suffix;
48 3
        $this->pType = "p" . $suffix;
49 3
        $this->eType = "e" . $suffix;
50 3
        $this->mType = "m" . $suffix;
51 2
    }
52
}
53