@@ -384,9 +384,9 @@ public function removeAllResources()
384384 * Allows one or more Roles access to [certain $privileges upon] the specified Resource(s).
385385 * If $assertion is provided, then it must return true in order for rule to apply.
386386 *
387- * @param string|string[]|Permission::ALL
388- * @param string|string[]|Permission::ALL
389- * @param string|string[]|Permission::ALL
387+ * @param string|string[]|null $roles
388+ * @param string|string[]|null $resources
389+ * @param string|string[]|null $privileges
390390 * @return static
391391 */
392392 public function allow ($ roles = self ::ALL , $ resources = self ::ALL , $ privileges = self ::ALL , callable $ assertion = null )
@@ -400,9 +400,9 @@ public function allow($roles = self::ALL, $resources = self::ALL, $privileges =
400400 * Denies one or more Roles access to [certain $privileges upon] the specified Resource(s).
401401 * If $assertion is provided, then it must return true in order for rule to apply.
402402 *
403- * @param string|string[]|Permission::ALL
404- * @param string|string[]|Permission::ALL
405- * @param string|string[]|Permission::ALL
403+ * @param string|string[]|null $roles
404+ * @param string|string[]|null $resources
405+ * @param string|string[]|null $privileges
406406 * @return static
407407 */
408408 public function deny ($ roles = self ::ALL , $ resources = self ::ALL , $ privileges = self ::ALL , callable $ assertion = null )
@@ -415,9 +415,9 @@ public function deny($roles = self::ALL, $resources = self::ALL, $privileges = s
415415 /**
416416 * Removes "allow" permissions from the list in the context of the given Roles, Resources, and privileges.
417417 *
418- * @param string|string[]|Permission::ALL
419- * @param string|string[]|Permission::ALL
420- * @param string|string[]|Permission::ALL
418+ * @param string|string[]|null $roles
419+ * @param string|string[]|null $resources
420+ * @param string|string[]|null $privileges
421421 * @return static
422422 */
423423 public function removeAllow ($ roles = self ::ALL , $ resources = self ::ALL , $ privileges = self ::ALL )
@@ -430,9 +430,9 @@ public function removeAllow($roles = self::ALL, $resources = self::ALL, $privile
430430 /**
431431 * Removes "deny" restrictions from the list in the context of the given Roles, Resources, and privileges.
432432 *
433- * @param string|string[]|Permission::ALL
434- * @param string|string[]|Permission::ALL
435- * @param string|string[]|Permission::ALL
433+ * @param string|string[]|null $roles
434+ * @param string|string[]|null $resources
435+ * @param string|string[]|null $privileges
436436 * @return static
437437 */
438438 public function removeDeny ($ roles = self ::ALL , $ resources = self ::ALL , $ privileges = self ::ALL )
@@ -444,11 +444,9 @@ public function removeDeny($roles = self::ALL, $resources = self::ALL, $privileg
444444
445445 /**
446446 * Performs operations on Access Control List rules.
447- * @param bool operation add?
448- * @param bool type
449- * @param string|string[]|Permission::ALL
450- * @param string|string[]|Permission::ALL
451- * @param string|string[]|Permission::ALL
447+ * @param string|string[]|null $roles
448+ * @param string|string[]|null $resources
449+ * @param string|string[]|null $privileges
452450 * @throws Nette\InvalidStateException
453451 * @return static
454452 */
@@ -559,9 +557,9 @@ protected function setRule(bool $toAdd, bool $type, $roles, $resources, $privile
559557 * and its respective parents are checked similarly before the lower-priority parents of
560558 * the Role are checked.
561559 *
562- * @param string|Permission::ALL |IRole
563- * @param string|Permission::ALL |IResource
564- * @param string|Permission::ALL
560+ * @param string|null |IRole $role
561+ * @param string|null |IResource $resource
562+ * @param string|null $privilege
565563 * @throws Nette\InvalidStateException
566564 */
567565 public function isAllowed ($ role = self ::ALL , $ resource = self ::ALL , $ privilege = self ::ALL ): bool
@@ -642,7 +640,7 @@ public function getQueriedResource()
642640 /**
643641 * Performs a depth-first search of the Role DAG, starting at $role, in order to find a rule
644642 * allowing/denying $role access to a/all $privilege upon $resource.
645- * @param bool all (true) or one?
643+ * @param bool $ all (true) or one?
646644 * @return mixed null if no applicable rule is found, otherwise returns ALLOW or DENY
647645 */
648646 private function searchRolePrivileges (bool $ all , $ role , $ resource , $ privilege )
@@ -687,9 +685,9 @@ private function searchRolePrivileges(bool $all, $role, $resource, $privilege)
687685
688686 /**
689687 * Returns the rule type associated with the specified Resource, Role, and privilege.
690- * @param string|Permission::ALL
691- * @param string|Permission::ALL
692- * @param string|Permission::ALL
688+ * @param string|null $resource
689+ * @param string|null $role
690+ * @param string|null $privilege
693691 * @return bool|null null if a rule does not exist or assertion fails, otherwise returns ALLOW or DENY
694692 */
695693 private function getRuleType ($ resource , $ role , $ privilege ): ?bool
@@ -729,8 +727,8 @@ private function getRuleType($resource, $role, $privilege): ?bool
729727 /**
730728 * Returns the rules associated with a Resource and a Role, or null if no such rules exist.
731729 * If the $create parameter is true, then a rule set is first created and then returned to the caller.
732- * @param string|Permission::ALL
733- * @param string|Permission::ALL
730+ * @param string|null $resource
731+ * @param string|null $role
734732 */
735733 private function &getRules ($ resource , $ role , bool $ create = false ): ?array
736734 {
0 commit comments