Skip to content

Commit 2082793

Browse files
adaamzdg
authored andcommitted
Permission: removed useless condition (#33)
1 parent 55b6f3e commit 2082793

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Security/Permission.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function hasRole(string $role): bool
107107
*/
108108
private function checkRole(string $role, bool $throw = true): void
109109
{
110-
if (!is_string($role) || $role === '') {
110+
if ($role === '') {
111111
throw new Nette\InvalidArgumentException('Role must be a non-empty string.');
112112

113113
} elseif ($throw && !isset($this->roles[$role])) {
@@ -272,7 +272,7 @@ public function hasResource(string $resource): bool
272272
*/
273273
private function checkResource(string $resource, bool $throw = true): void
274274
{
275-
if (!is_string($resource) || $resource === '') {
275+
if ($resource === '') {
276276
throw new Nette\InvalidArgumentException('Resource must be a non-empty string.');
277277

278278
} elseif ($throw && !isset($this->resources[$resource])) {

0 commit comments

Comments
 (0)