mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 13:02:24 +08:00
Fixes #12055: Changed boolean to bool and integer to int in phpdoc
This commit is contained in:
committed by
Alexander Makarov
parent
940f7c7cd4
commit
4aa935e69e
@ -22,7 +22,7 @@ use yii\base\Object;
|
||||
class Assignment extends Object
|
||||
{
|
||||
/**
|
||||
* @var string|integer user ID (see [[\yii\web\User::id]])
|
||||
* @var string|int user ID (see [[\yii\web\User::id]])
|
||||
*/
|
||||
public $userId;
|
||||
/**
|
||||
@ -30,7 +30,7 @@ class Assignment extends Object
|
||||
*/
|
||||
public $roleName;
|
||||
/**
|
||||
* @var integer UNIX timestamp representing the assignment creation time
|
||||
* @var int UNIX timestamp representing the assignment creation time
|
||||
*/
|
||||
public $createdAt;
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ abstract class BaseManager extends Component implements ManagerInterface
|
||||
|
||||
/**
|
||||
* Returns the items of the specified type.
|
||||
* @param integer $type the auth item type (either [[Item::TYPE_ROLE]] or [[Item::TYPE_PERMISSION]]
|
||||
* @param int $type the auth item type (either [[Item::TYPE_ROLE]] or [[Item::TYPE_PERMISSION]]
|
||||
* @return Item[] the auth items of the specified type.
|
||||
*/
|
||||
abstract protected function getItems($type);
|
||||
@ -44,7 +44,7 @@ abstract class BaseManager extends Component implements ManagerInterface
|
||||
/**
|
||||
* Adds an auth item to the RBAC system.
|
||||
* @param Item $item the item to add
|
||||
* @return boolean whether the auth item is successfully added to the system
|
||||
* @return bool whether the auth item is successfully added to the system
|
||||
* @throws \Exception if data validation or saving fails (such as the name of the role or permission is not unique)
|
||||
*/
|
||||
abstract protected function addItem($item);
|
||||
@ -52,7 +52,7 @@ abstract class BaseManager extends Component implements ManagerInterface
|
||||
/**
|
||||
* Adds a rule to the RBAC system.
|
||||
* @param Rule $rule the rule to add
|
||||
* @return boolean whether the rule is successfully added to the system
|
||||
* @return bool whether the rule is successfully added to the system
|
||||
* @throws \Exception if data validation or saving fails (such as the name of the rule is not unique)
|
||||
*/
|
||||
abstract protected function addRule($rule);
|
||||
@ -60,7 +60,7 @@ abstract class BaseManager extends Component implements ManagerInterface
|
||||
/**
|
||||
* Removes an auth item from the RBAC system.
|
||||
* @param Item $item the item to remove
|
||||
* @return boolean whether the role or permission is successfully removed
|
||||
* @return bool whether the role or permission is successfully removed
|
||||
* @throws \Exception if data validation or saving fails (such as the name of the role or permission is not unique)
|
||||
*/
|
||||
abstract protected function removeItem($item);
|
||||
@ -68,7 +68,7 @@ abstract class BaseManager extends Component implements ManagerInterface
|
||||
/**
|
||||
* Removes a rule from the RBAC system.
|
||||
* @param Rule $rule the rule to remove
|
||||
* @return boolean whether the rule is successfully removed
|
||||
* @return bool whether the rule is successfully removed
|
||||
* @throws \Exception if data validation or saving fails (such as the name of the rule is not unique)
|
||||
*/
|
||||
abstract protected function removeRule($rule);
|
||||
@ -77,7 +77,7 @@ abstract class BaseManager extends Component implements ManagerInterface
|
||||
* Updates an auth item in the RBAC system.
|
||||
* @param string $name the name of the item being updated
|
||||
* @param Item $item the updated item
|
||||
* @return boolean whether the auth item is successfully updated
|
||||
* @return bool whether the auth item is successfully updated
|
||||
* @throws \Exception if data validation or saving fails (such as the name of the role or permission is not unique)
|
||||
*/
|
||||
abstract protected function updateItem($name, $item);
|
||||
@ -86,7 +86,7 @@ abstract class BaseManager extends Component implements ManagerInterface
|
||||
* Updates a rule to the RBAC system.
|
||||
* @param string $name the name of the rule being updated
|
||||
* @param Rule $rule the updated rule
|
||||
* @return boolean whether the rule is successfully updated
|
||||
* @return bool whether the rule is successfully updated
|
||||
* @throws \Exception if data validation or saving fails (such as the name of the rule is not unique)
|
||||
*/
|
||||
abstract protected function updateRule($name, $rule);
|
||||
@ -203,11 +203,11 @@ abstract class BaseManager extends Component implements ManagerInterface
|
||||
* If the item does not specify a rule, this method will return true. Otherwise, it will
|
||||
* return the value of [[Rule::execute()]].
|
||||
*
|
||||
* @param string|integer $user the user ID. This should be either an integer or a string representing
|
||||
* @param string|int $user the user ID. This should be either an integer or a string representing
|
||||
* the unique identifier of a user. See [[\yii\web\User::id]].
|
||||
* @param Item $item the auth item that needs to execute its rule
|
||||
* @param array $params parameters passed to [[CheckAccessInterface::checkAccess()]] and will be passed to the rule
|
||||
* @return boolean the return value of [[Rule::execute()]]. If the auth item does not specify a rule, true will be returned.
|
||||
* @return bool the return value of [[Rule::execute()]]. If the auth item does not specify a rule, true will be returned.
|
||||
* @throws InvalidConfigException if the auth item has an invalid rule.
|
||||
*/
|
||||
protected function executeRule($user, $item, $params)
|
||||
|
||||
@ -17,12 +17,12 @@ interface CheckAccessInterface
|
||||
{
|
||||
/**
|
||||
* Checks if the user has the specified permission.
|
||||
* @param string|integer $userId the user ID. This should be either an integer or a string representing
|
||||
* @param string|int $userId the user ID. This should be either an integer or a string representing
|
||||
* the unique identifier of a user. See [[\yii\web\User::id]].
|
||||
* @param string $permissionName the name of the permission to be checked against
|
||||
* @param array $params name-value pairs that will be passed to the rules associated
|
||||
* with the roles and permissions assigned to the user.
|
||||
* @return boolean whether the user has the specified permission.
|
||||
* @return bool whether the user has the specified permission.
|
||||
* @throws \yii\base\InvalidParamException if $permissionName does not refer to an existing permission
|
||||
*/
|
||||
public function checkAccess($userId, $permissionName, $params = []);
|
||||
|
||||
@ -132,14 +132,14 @@ class DbManager extends BaseManager
|
||||
/**
|
||||
* Performs access check for the specified user based on the data loaded from cache.
|
||||
* This method is internally called by [[checkAccess()]] when [[cache]] is enabled.
|
||||
* @param string|integer $user the user ID. This should can be either an integer or a string representing
|
||||
* @param string|int $user the user ID. This should can be either an integer or a string representing
|
||||
* the unique identifier of a user. See [[\yii\web\User::id]].
|
||||
* @param string $itemName the name of the operation that need access check
|
||||
* @param array $params name-value pairs that would be passed to rules associated
|
||||
* with the tasks and roles assigned to the user. A param with name 'user' is added to this array,
|
||||
* which holds the value of `$userId`.
|
||||
* @param Assignment[] $assignments the assignments to the specified user
|
||||
* @return boolean whether the operations can be performed by the user.
|
||||
* @return bool whether the operations can be performed by the user.
|
||||
* @since 2.0.3
|
||||
*/
|
||||
protected function checkAccessFromCache($user, $itemName, $params, $assignments)
|
||||
@ -174,14 +174,14 @@ class DbManager extends BaseManager
|
||||
/**
|
||||
* Performs access check for the specified user.
|
||||
* This method is internally called by [[checkAccess()]].
|
||||
* @param string|integer $user the user ID. This should can be either an integer or a string representing
|
||||
* @param string|int $user the user ID. This should can be either an integer or a string representing
|
||||
* the unique identifier of a user. See [[\yii\web\User::id]].
|
||||
* @param string $itemName the name of the operation that need access check
|
||||
* @param array $params name-value pairs that would be passed to rules associated
|
||||
* with the tasks and roles assigned to the user. A param with name 'user' is added to this array,
|
||||
* which holds the value of `$userId`.
|
||||
* @param Assignment[] $assignments the assignments to the specified user
|
||||
* @return boolean whether the operations can be performed by the user.
|
||||
* @return bool whether the operations can be performed by the user.
|
||||
*/
|
||||
protected function checkAccessRecursive($user, $itemName, $params, $assignments)
|
||||
{
|
||||
@ -244,7 +244,7 @@ class DbManager extends BaseManager
|
||||
/**
|
||||
* Returns a value indicating whether the database supports cascading update and delete.
|
||||
* The default implementation will return false for SQLite database and true for all other databases.
|
||||
* @return boolean whether the database supports cascading update and delete.
|
||||
* @return bool whether the database supports cascading update and delete.
|
||||
*/
|
||||
protected function supportsCascadeUpdate()
|
||||
{
|
||||
@ -534,7 +534,7 @@ class DbManager extends BaseManager
|
||||
|
||||
/**
|
||||
* Returns all permissions that are directly assigned to user.
|
||||
* @param string|integer $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @param string|int $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @return Permission[] all direct permissions that the user has. The array is indexed by the permission names.
|
||||
* @since 2.0.7
|
||||
*/
|
||||
@ -555,7 +555,7 @@ class DbManager extends BaseManager
|
||||
|
||||
/**
|
||||
* Returns all permissions that the user inherits from the roles assigned to him.
|
||||
* @param string|integer $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @param string|int $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @return Permission[] all inherited permissions that the user has. The array is indexed by the permission names.
|
||||
* @since 2.0.7
|
||||
*/
|
||||
@ -797,7 +797,7 @@ class DbManager extends BaseManager
|
||||
* Checks whether there is a loop in the authorization item hierarchy.
|
||||
* @param Item $parent the parent item
|
||||
* @param Item $child the child item to be added to the hierarchy
|
||||
* @return boolean whether a loop exists
|
||||
* @return bool whether a loop exists
|
||||
*/
|
||||
protected function detectLoop($parent, $child)
|
||||
{
|
||||
@ -891,7 +891,7 @@ class DbManager extends BaseManager
|
||||
|
||||
/**
|
||||
* Removes all auth items of the specified type.
|
||||
* @param integer $type the auth item type (either Item::TYPE_PERMISSION or Item::TYPE_ROLE)
|
||||
* @param int $type the auth item type (either Item::TYPE_PERMISSION or Item::TYPE_ROLE)
|
||||
*/
|
||||
protected function removeAllItems($type)
|
||||
{
|
||||
|
||||
@ -21,7 +21,7 @@ class Item extends Object
|
||||
const TYPE_PERMISSION = 2;
|
||||
|
||||
/**
|
||||
* @var integer the type of the item. This should be either [[TYPE_ROLE]] or [[TYPE_PERMISSION]].
|
||||
* @var int the type of the item. This should be either [[TYPE_ROLE]] or [[TYPE_PERMISSION]].
|
||||
*/
|
||||
public $type;
|
||||
/**
|
||||
@ -41,11 +41,11 @@ class Item extends Object
|
||||
*/
|
||||
public $data;
|
||||
/**
|
||||
* @var integer UNIX timestamp representing the item creation time
|
||||
* @var int UNIX timestamp representing the item creation time
|
||||
*/
|
||||
public $createdAt;
|
||||
/**
|
||||
* @var integer UNIX timestamp representing the item updating time
|
||||
* @var int UNIX timestamp representing the item updating time
|
||||
*/
|
||||
public $updatedAt;
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
/**
|
||||
* Adds a role, permission or rule to the RBAC system.
|
||||
* @param Role|Permission|Rule $object
|
||||
* @return boolean whether the role, permission or rule is successfully added to the system
|
||||
* @return bool whether the role, permission or rule is successfully added to the system
|
||||
* @throws \Exception if data validation or saving fails (such as the name of the role or permission is not unique)
|
||||
*/
|
||||
public function add($object);
|
||||
@ -44,7 +44,7 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
/**
|
||||
* Removes a role, permission or rule from the RBAC system.
|
||||
* @param Role|Permission|Rule $object
|
||||
* @return boolean whether the role, permission or rule is successfully removed
|
||||
* @return bool whether the role, permission or rule is successfully removed
|
||||
*/
|
||||
public function remove($object);
|
||||
|
||||
@ -52,7 +52,7 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
* Updates the specified role, permission or rule in the system.
|
||||
* @param string $name the old name of the role, permission or rule
|
||||
* @param Role|Permission|Rule $object
|
||||
* @return boolean whether the update is successful
|
||||
* @return bool whether the update is successful
|
||||
* @throws \Exception if data validation or saving fails (such as the name of the role or permission is not unique)
|
||||
*/
|
||||
public function update($name, $object);
|
||||
@ -73,7 +73,7 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
/**
|
||||
* Returns the roles that are assigned to the user via [[assign()]].
|
||||
* Note that child roles that are not assigned directly to the user will not be returned.
|
||||
* @param string|integer $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @param string|int $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @return Role[] all roles directly assigned to the user. The array is indexed by the role names.
|
||||
*/
|
||||
public function getRolesByUser($userId);
|
||||
@ -110,7 +110,7 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
|
||||
/**
|
||||
* Returns all permissions that the user has.
|
||||
* @param string|integer $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @param string|int $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @return Permission[] all permissions that the user has. The array is indexed by the permission names.
|
||||
*/
|
||||
public function getPermissionsByUser($userId);
|
||||
@ -132,7 +132,7 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
* Checks the possibility of adding a child to parent
|
||||
* @param Item $parent the parent item
|
||||
* @param Item $child the child item to be added to the hierarchy
|
||||
* @return boolean possibility of adding
|
||||
* @return bool possibility of adding
|
||||
*
|
||||
* @since 2.0.8
|
||||
*/
|
||||
@ -142,7 +142,7 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
* Adds an item as a child of another item.
|
||||
* @param Item $parent
|
||||
* @param Item $child
|
||||
* @return boolean whether the child successfully added
|
||||
* @return bool whether the child successfully added
|
||||
* @throws \yii\base\Exception if the parent-child relationship already exists or if a loop has been detected.
|
||||
*/
|
||||
public function addChild($parent, $child);
|
||||
@ -152,7 +152,7 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
* Note, the child item is not deleted. Only the parent-child relationship is removed.
|
||||
* @param Item $parent
|
||||
* @param Item $child
|
||||
* @return boolean whether the removal is successful
|
||||
* @return bool whether the removal is successful
|
||||
*/
|
||||
public function removeChild($parent, $child);
|
||||
|
||||
@ -160,7 +160,7 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
* Removed all children form their parent.
|
||||
* Note, the children items are not deleted. Only the parent-child relationships are removed.
|
||||
* @param Item $parent
|
||||
* @return boolean whether the removal is successful
|
||||
* @return bool whether the removal is successful
|
||||
*/
|
||||
public function removeChildren($parent);
|
||||
|
||||
@ -168,7 +168,7 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
* Returns a value indicating whether the child already exists for the parent.
|
||||
* @param Item $parent
|
||||
* @param Item $child
|
||||
* @return boolean whether `$child` is already a child of `$parent`
|
||||
* @return bool whether `$child` is already a child of `$parent`
|
||||
*/
|
||||
public function hasChild($parent, $child);
|
||||
|
||||
@ -183,7 +183,7 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
* Assigns a role to a user.
|
||||
*
|
||||
* @param Role $role
|
||||
* @param string|integer $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @param string|int $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @return Assignment the role assignment information.
|
||||
* @throws \Exception if the role has already been assigned to the user
|
||||
*/
|
||||
@ -192,22 +192,22 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
/**
|
||||
* Revokes a role from a user.
|
||||
* @param Role $role
|
||||
* @param string|integer $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @return boolean whether the revoking is successful
|
||||
* @param string|int $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @return bool whether the revoking is successful
|
||||
*/
|
||||
public function revoke($role, $userId);
|
||||
|
||||
/**
|
||||
* Revokes all roles from a user.
|
||||
* @param mixed $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @return boolean whether the revoking is successful
|
||||
* @return bool whether the revoking is successful
|
||||
*/
|
||||
public function revokeAll($userId);
|
||||
|
||||
/**
|
||||
* Returns the assignment information regarding a role and a user.
|
||||
* @param string $roleName the role name
|
||||
* @param string|integer $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @param string|int $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @return null|Assignment the assignment information. Null is returned if
|
||||
* the role is not assigned to the user.
|
||||
*/
|
||||
@ -215,7 +215,7 @@ interface ManagerInterface extends CheckAccessInterface
|
||||
|
||||
/**
|
||||
* Returns all role assignment information for the specified user.
|
||||
* @param string|integer $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @param string|int $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @return Assignment[] the assignments indexed by role names. An empty array will be
|
||||
* returned if there is no role assigned to the user.
|
||||
*/
|
||||
|
||||
@ -114,14 +114,14 @@ class PhpManager extends BaseManager
|
||||
* Performs access check for the specified user.
|
||||
* This method is internally called by [[checkAccess()]].
|
||||
*
|
||||
* @param string|integer $user the user ID. This should can be either an integer or a string representing
|
||||
* @param string|int $user the user ID. This should can be either an integer or a string representing
|
||||
* the unique identifier of a user. See [[\yii\web\User::id]].
|
||||
* @param string $itemName the name of the operation that need access check
|
||||
* @param array $params name-value pairs that would be passed to rules associated
|
||||
* with the tasks and roles assigned to the user. A param with name 'user' is added to this array,
|
||||
* which holds the value of `$userId`.
|
||||
* @param Assignment[] $assignments the assignments to the specified user
|
||||
* @return boolean whether the operations can be performed by the user.
|
||||
* @return bool whether the operations can be performed by the user.
|
||||
*/
|
||||
protected function checkAccessRecursive($user, $itemName, $params, $assignments)
|
||||
{
|
||||
@ -192,7 +192,7 @@ class PhpManager extends BaseManager
|
||||
*
|
||||
* @param Item $parent parent item
|
||||
* @param Item $child the child item that is to be added to the hierarchy
|
||||
* @return boolean whether a loop exists
|
||||
* @return bool whether a loop exists
|
||||
*/
|
||||
protected function detectLoop($parent, $child)
|
||||
{
|
||||
@ -469,7 +469,7 @@ class PhpManager extends BaseManager
|
||||
|
||||
/**
|
||||
* Returns all permissions that are directly assigned to user.
|
||||
* @param string|integer $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @param string|int $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @return Permission[] all direct permissions that the user has. The array is indexed by the permission names.
|
||||
* @since 2.0.7
|
||||
*/
|
||||
@ -488,7 +488,7 @@ class PhpManager extends BaseManager
|
||||
|
||||
/**
|
||||
* Returns all permissions that the user inherits from the roles assigned to him.
|
||||
* @param string|integer $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @param string|int $userId the user ID (see [[\yii\web\User::id]])
|
||||
* @return Permission[] all inherited permissions that the user has. The array is indexed by the permission names.
|
||||
* @since 2.0.7
|
||||
*/
|
||||
@ -551,7 +551,7 @@ class PhpManager extends BaseManager
|
||||
|
||||
/**
|
||||
* Removes all auth items of the specified type.
|
||||
* @param integer $type the auth item type (either Item::TYPE_PERMISSION or Item::TYPE_ROLE)
|
||||
* @param int $type the auth item type (either Item::TYPE_PERMISSION or Item::TYPE_ROLE)
|
||||
*/
|
||||
protected function removeAllItems($type)
|
||||
{
|
||||
|
||||
@ -24,11 +24,11 @@ abstract class Rule extends Object
|
||||
*/
|
||||
public $name;
|
||||
/**
|
||||
* @var integer UNIX timestamp representing the rule creation time
|
||||
* @var int UNIX timestamp representing the rule creation time
|
||||
*/
|
||||
public $createdAt;
|
||||
/**
|
||||
* @var integer UNIX timestamp representing the rule updating time
|
||||
* @var int UNIX timestamp representing the rule updating time
|
||||
*/
|
||||
public $updatedAt;
|
||||
|
||||
@ -36,11 +36,11 @@ abstract class Rule extends Object
|
||||
/**
|
||||
* Executes the rule.
|
||||
*
|
||||
* @param string|integer $user the user ID. This should be either an integer or a string representing
|
||||
* @param string|int $user the user ID. This should be either an integer or a string representing
|
||||
* the unique identifier of a user. See [[\yii\web\User::id]].
|
||||
* @param Item $item the role or permission that this rule is associated with
|
||||
* @param array $params parameters passed to [[CheckAccessInterface::checkAccess()]].
|
||||
* @return boolean a value indicating whether the rule permits the auth item it is associated with.
|
||||
* @return bool a value indicating whether the rule permits the auth item it is associated with.
|
||||
*/
|
||||
abstract public function execute($user, $item, $params);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user