Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 19, 2019
1 parent 209f735 commit fd6a384
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Security/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}
Expand Down Expand Up @@ -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.");
}
}
Expand Down

0 comments on commit fd6a384

Please sign in to comment.