@@ 81-90 (lines=10) @@ | ||
78 | /** |
|
79 | * {@inheritdoc} |
|
80 | */ |
|
81 | public function addRole($role) |
|
82 | { |
|
83 | $role = strtoupper($role); |
|
84 | ||
85 | if (!in_array($role, $this->roles)) { |
|
86 | $this->roles[] = $role; |
|
87 | } |
|
88 | ||
89 | return $this; |
|
90 | } |
|
91 | ||
92 | /** |
|
93 | * {@inheritdoc} |
|
@@ 95-104 (lines=10) @@ | ||
92 | /** |
|
93 | * {@inheritdoc} |
|
94 | */ |
|
95 | public function removeRole($role) |
|
96 | { |
|
97 | $role = strtoupper($role); |
|
98 | ||
99 | if (in_array($role, $this->roles)) { |
|
100 | $this->roles = array_diff($this->roles, [$role]); |
|
101 | } |
|
102 | ||
103 | return $this; |
|
104 | } |
|
105 | ||
106 | /** |
|
107 | * {@inheritdoc} |