File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ The recommended way to install is via Composer:
3333composer 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
3939Authentication
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments