Skip to content

Commit 4d7348d

Browse files
committed
typo
1 parent f18cf84 commit 4d7348d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The recommended way to install is via Composer:
3333
composer require nette/security
3434
```
3535

36-
It requires PHP version 7.1 and supports PHP up to 7.3.
36+
It requires PHP version 7.1 and supports PHP up to 7.4.
3737

3838

3939
Authentication

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)