Skip to content
Permalink
Browse files

typo

  • Loading branch information...
dg committed Nov 1, 2019
1 parent f18cf84 commit c25fc5b22564cd75843e448333e30a8ffb6bace5
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/Security/Permission.php
@@ -105,12 +105,12 @@ public function hasRole(string $role): bool
* Checks whether Role is valid and exists in the list.
* @throws Nette\InvalidStateException
*/
private function checkRole(string $role, bool $throw = true): void
private function checkRole(string $role, bool $exists = true): void
{
if ($role === '') {
throw new Nette\InvalidArgumentException('Role must be a non-empty string.');
} elseif ($throw && !isset($this->roles[$role])) {
} elseif ($exists && !isset($this->roles[$role])) {
throw new Nette\InvalidStateException("Role '$role' does not exist.");
}
}
@@ -270,12 +270,12 @@ public function hasResource(string $resource): bool
* Checks whether Resource is valid and exists in the list.
* @throws Nette\InvalidStateException
*/
private function checkResource(string $resource, bool $throw = true): void
private function checkResource(string $resource, bool $exists = true): void
{
if ($resource === '') {
throw new Nette\InvalidArgumentException('Resource must be a non-empty string.');
} elseif ($throw && !isset($this->resources[$resource])) {
} elseif ($exists && !isset($this->resources[$resource])) {
throw new Nette\InvalidStateException("Resource '$resource' does not exist.");
}
}

0 comments on commit c25fc5b

Please sign in to comment.
You can’t perform that action at this time.