Skip to content

Commit fd6a384

Browse files
committed
typo
1 parent 209f735 commit fd6a384

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Security/Permission.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ public function hasRole(string $role): bool
105105
* Checks whether Role is valid and exists in the list.
106106
* @throws Nette\InvalidStateException
107107
*/
108-
private function checkRole(string $role, bool $throw = true): void
108+
private function checkRole(string $role, bool $exists = true): void
109109
{
110110
if ($role === '') {
111111
throw new Nette\InvalidArgumentException('Role must be a non-empty string.');
112112

113-
} elseif ($throw && !isset($this->roles[$role])) {
113+
} elseif ($exists && !isset($this->roles[$role])) {
114114
throw new Nette\InvalidStateException("Role '$role' does not exist.");
115115
}
116116
}
@@ -270,12 +270,12 @@ public function hasResource(string $resource): bool
270270
* Checks whether Resource is valid and exists in the list.
271271
* @throws Nette\InvalidStateException
272272
*/
273-
private function checkResource(string $resource, bool $throw = true): void
273+
private function checkResource(string $resource, bool $exists = true): void
274274
{
275275
if ($resource === '') {
276276
throw new Nette\InvalidArgumentException('Resource must be a non-empty string.');
277277

278-
} elseif ($throw && !isset($this->resources[$resource])) {
278+
} elseif ($exists && !isset($this->resources[$resource])) {
279279
throw new Nette\InvalidStateException("Resource '$resource' does not exist.");
280280
}
281281
}

0 commit comments

Comments
 (0)