1414use yii \base \InvalidConfigException ;
1515use yii \helpers \IpHelper ;
1616use yii \helpers \StringHelper ;
17+ use yii \web \IdentityInterface ;
1718use yii \web \Request ;
1819use yii \web \User ;
1920
@@ -166,6 +167,12 @@ class AccessRule extends Component
166167 * @param User|false $user the user object or `false` in case of detached User component
167168 * @param Request $request
168169 * @return bool|null `true` if the user is allowed, `false` if the user is denied, `null` if the rule does not apply to the user
170+ *
171+ * @phpstan-param Action<Controller> $action
172+ * @psalm-param Action<Controller> $action
173+ *
174+ * @phpstan-param User<IdentityInterface>|false $user
175+ * @psalm-param User<IdentityInterface>|false $user
169176 */
170177 public function allows ($ action , $ user , $ request )
171178 {
@@ -186,6 +193,9 @@ public function allows($action, $user, $request)
186193 /**
187194 * @param Action $action the action
188195 * @return bool whether the rule applies to the action
196+ *
197+ * @phpstan-param Action<Controller> $action
198+ * @psalm-param Action<Controller> $action
189199 */
190200 protected function matchAction ($ action )
191201 {
@@ -216,6 +226,9 @@ protected function matchController($controller)
216226 * @param User $user the user object
217227 * @return bool whether the rule applies to the role
218228 * @throws InvalidConfigException if User component is detached
229+ *
230+ * @phpstan-param User<IdentityInterface> $user
231+ * @psalm-param User<IdentityInterface> $user
219232 */
220233 protected function matchRole ($ user )
221234 {
@@ -297,6 +310,9 @@ protected function matchVerb($verb)
297310 /**
298311 * @param Action $action the action to be performed
299312 * @return bool whether the rule should be applied
313+ *
314+ * @phpstan-param Action<Controller> $action
315+ * @psalm-param Action<Controller> $action
300316 */
301317 protected function matchCustom ($ action )
302318 {
0 commit comments