Skip to content

Commit edf349e

Browse files
committed
phpDoc: added $var name to @param
1 parent 5c4065c commit edf349e

File tree

4 files changed

+32
-34
lines changed

4 files changed

+32
-34
lines changed

src/Security/IAuthorizator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ interface IAuthorizator
2727

2828
/**
2929
* Performs a role-based authorization.
30-
* @param string|null
31-
* @param string|null
32-
* @param string|null
30+
* @param string|null $role
31+
* @param string|null $resource
32+
* @param string|null $privilege
3333
*/
3434
function isAllowed($role, $resource, $privilege): bool;
3535
}

src/Security/Permission.php

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -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
{

src/Security/SimpleAuthenticator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class SimpleAuthenticator implements IAuthenticator
2727

2828

2929
/**
30-
* @param array list of pairs username => password
31-
* @param array list of pairs username => role[]
30+
* @param array $userlist list of pairs username => password
31+
* @param array $usersRoles list of pairs username => role[]
3232
*/
3333
public function __construct(array $userlist, array $usersRoles = [])
3434
{

src/Security/User.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ final public function getStorage(): IUserStorage
7373

7474
/**
7575
* Conducts the authentication process. Parameters are optional.
76-
* @param string|IIdentity username or Identity
76+
* @param string|IIdentity $user name or Identity
7777
* @throws AuthenticationException if authentication was not successful
7878
*/
7979
public function login($user, string $password = null): void
@@ -157,8 +157,8 @@ final public function getAuthenticator(bool $throw = true): ?IAuthenticator
157157

158158
/**
159159
* Enables log out after inactivity (like '20 minutes'). Accepts flag IUserStorage::CLEAR_IDENTITY.
160-
* @param string|null
161-
* @param int
160+
* @param string|null $expire
161+
* @param int $flags
162162
* @return static
163163
*/
164164
public function setExpiration($expire, /*int*/$flags = 0)

0 commit comments

Comments
 (0)