From 2794e25ad6dc95f38254948d3050b088e2627a11 Mon Sep 17 00:00:00 2001 From: Neo Andreyson Date: Sun, 21 Jan 2024 22:28:15 +0200 Subject: [PATCH] Remove unnecessary check in the AccessRule::matchRole() --- framework/filters/AccessRule.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/framework/filters/AccessRule.php b/framework/filters/AccessRule.php index decb4365a86..476c86e9958 100644 --- a/framework/filters/AccessRule.php +++ b/framework/filters/AccessRule.php @@ -242,9 +242,7 @@ protected function matchRole($user) return true; } } else { - if (!isset($roleParams)) { - $roleParams = !is_array($this->roleParams) && is_callable($this->roleParams) ? call_user_func($this->roleParams, $this) : $this->roleParams; - } + $roleParams = !is_array($this->roleParams) && is_callable($this->roleParams) ? call_user_func($this->roleParams, $this) : $this->roleParams; if ($user->can($item, $roleParams)) { return true; }