Passed
Push — master ( 9400c7...f5da21 )
by Peter
02:36
created

Item::getRole()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Framework\Navigation;
6
7
use AbterPhp\Framework\Authorization\Constant\Role;
8
use AbterPhp\Framework\Constant\Html5;
9
use AbterPhp\Framework\Html\Component;
10
11
class Item extends Component implements IResourcable
12
{
13
    const DEFAULT_TAG = Html5::TAG_LI;
14
15
    const INTENT_DROPDOWN = 'dropdown';
16
17
    /** @var string|null */
18
    protected $resource = null;
19
20
    /** @var string */
21
    protected $role = Role::READ;
22
23
    /**
24
     * @param string|null $resource
25
     *
26
     * @return $this
27
     */
28
    public function setResource(?string $resource): IResourcable
29
    {
30
        $this->resource = $resource;
31
32
        return $this;
33
    }
34
35
    /**
36
     * @return string|null
37
     */
38
    public function getResource(): ?string
39
    {
40
        return $this->resource;
41
    }
42
43
    /**
44
     * @param string|null $resource
45
     *
46
     * @return $this
47
     */
48
    public function setRole(?string $role): IResourcable
49
    {
50
        $this->role = $role;
51
52
        return $this;
53
    }
54
55
    /**
56
     * @return $this
57
     */
58
    public function getRole(): string
59
    {
60
        return $this->role;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->role returns the type string which is incompatible with the documented return type AbterPhp\Framework\Navigation\Item.
Loading history...
61
    }
62
}
63