Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 18, 2019
1 parent f18cf84 commit 4d7348d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The recommended way to install is via Composer:
composer require nette/security
```

It requires PHP version 7.1 and supports PHP up to 7.3.
It requires PHP version 7.1 and supports PHP up to 7.4.


Authentication
Expand Down
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 4d7348d

Please sign in to comment.