diff options
Diffstat (limited to 'src/database/databasetraits/RoleTrait.php')
-rw-r--r-- | src/database/databasetraits/RoleTrait.php | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/src/database/databasetraits/RoleTrait.php b/src/database/databasetraits/RoleTrait.php index 6b7150cc..0de70375 100644 --- a/src/database/databasetraits/RoleTrait.php +++ b/src/database/databasetraits/RoleTrait.php @@ -18,7 +18,7 @@ trait RoleTrait * * @param string $rolename (optional) The role name to exclude from the select * - * @return ADORecordSet|int + * @return \RecordSet|int|string */ public function getRoles($rolename = '') { @@ -56,7 +56,7 @@ trait RoleTrait * * @param string $rolename The name of the role to retrieve * - * @return ADORecordSet|int + * @return \RecordSet|int|string */ public function getRole($rolename) { @@ -88,7 +88,7 @@ trait RoleTrait /** * Returns all users in the database cluster. * - * @return ADORecordSet|int + * @return \RecordSet|int|string */ public function getUsers() { @@ -110,7 +110,7 @@ trait RoleTrait * * @param string $username The username of the user to retrieve * - * @return ADORecordSet|int + * @return \RecordSet|int|string */ public function getUser($username) { @@ -149,7 +149,7 @@ trait RoleTrait * @param array $new_members_of_role (array) Roles which are automatically added as members of the new role * @param array $new_admins_of_role (array) Roles which are automatically added as admin members of the new role * - * @return ADORecordSet|int + * @return int|string */ public function createRole( $rolename, @@ -258,7 +258,7 @@ trait RoleTrait * @param string $original_admins Original roles that are admin members of the role, comma separated * @param string $newrolename The new name of the role * - * @return bool|int 0 success + * @return int 0 success */ public function setRenameRole( $rolename, @@ -328,7 +328,7 @@ trait RoleTrait * @param string $rolename The name of the role to rename * @param string $newrolename The new name of the role * - * @return ADORecordSet|int + * @return int|string */ public function renameRole($rolename, $newrolename) { @@ -364,6 +364,8 @@ trait RoleTrait * @param string $original_admins Original roles that are admin members of the role, comma separated * * @return int 0 if operation was successful + * + * @psalm-return -1|0 */ public function setRole( $rolename, @@ -431,7 +433,7 @@ trait RoleTrait * @param string $rolename The name of the role that will belong to the target role * @param int $admin (optional) Flag to grant the admin option * - * @return ADORecordSet|int + * @return int|string */ public function grantRole($role, $rolename, $admin = 0) { @@ -459,7 +461,7 @@ trait RoleTrait * @param int $admin (optional) Flag to revoke only the admin option * @param string $type (optional) Type of revoke: RESTRICT | CASCADE * - * @return ADORecordSet|int + * @return int|string */ public function revokeRole($role, $rolename, $admin = 0, $type = 'RESTRICT') { @@ -487,7 +489,7 @@ trait RoleTrait * * @param string $rolename The name of the role to drop * - * @return ADORecordSet|int + * @return int|string */ public function dropRole($rolename) { @@ -511,7 +513,7 @@ trait RoleTrait * @param string $expiry string Format 'YYYY-MM-DD HH:MM:SS'. '' means never expire * @param array $groups The groups to create the user in * - * @return ADORecordSet|int + * @return int|string * * @internal param $group (array) The groups to create the user in */ @@ -564,7 +566,7 @@ trait RoleTrait * @param string $expiry string Format 'YYYY-MM-DD HH:MM:SS'. '' means never expire. * @param string $newname The new name of the user * - * @return bool|int 0 success + * @return int 0 success */ public function setRenameUser($username, $password, $createdb, $createuser, $expiry, $newname) { @@ -602,7 +604,7 @@ trait RoleTrait * @param string $username The username of the user to rename * @param string $newname The new name of the user * - * @return ADORecordSet|int + * @return int|string */ public function renameUser($username, $newname) { @@ -629,7 +631,7 @@ trait RoleTrait * @param bool $createuser boolean Whether or not the user can create other users * @param string $expiry string Format 'YYYY-MM-DD HH:MM:SS'. '' means never expire. * - * @return ADORecordSet|int + * @return int|string */ public function setUser($username, $password, $createdb, $createuser, $expiry) { @@ -670,7 +672,7 @@ trait RoleTrait * * @param string $username The username of the user to drop * - * @return ADORecordSet|int + * @return int|string */ public function dropUser($username) { @@ -690,7 +692,7 @@ trait RoleTrait * @param string $rolename The role name * @param string $password The new password * - * @return ADORecordSet|int + * @return int|string */ public function changePassword($rolename, $password) { @@ -713,7 +715,7 @@ trait RoleTrait * @param string $groname The name of the group * @param string $user The name of the user to add to the group * - * @return ADORecordSet|int + * @return int|string */ public function addGroupMember($groname, $user) { @@ -734,7 +736,7 @@ trait RoleTrait * * @param string $rolename The role name * - * @return ADORecordSet|int + * @return \RecordSet|int|string */ public function getMemberOf($rolename) { @@ -762,7 +764,7 @@ trait RoleTrait * @param string $rolename The role name * @param string $admin (optional) Find only admin members * - * @return ADORecordSet|int + * @return \RecordSet|int|string */ public function getMembers($rolename, $admin = 'f') { @@ -788,7 +790,7 @@ trait RoleTrait * @param string $groname The name of the group * @param string $user The name of the user to remove from the group * - * @return ADORecordSet|int + * @return int|string */ public function dropGroupMember($groname, $user) { @@ -809,7 +811,7 @@ trait RoleTrait * * @param string $groname The name of the group * - * @return ADORecordSet|int + * @return \RecordSet|int|string */ public function getGroup($groname) { @@ -829,7 +831,7 @@ trait RoleTrait /** * Returns all groups in the database cluser. * - * @return ADORecordSet|int + * @return \RecordSet|int|string */ public function getGroups() { @@ -844,7 +846,7 @@ trait RoleTrait * @param string $groname The name of the group * @param array $users An array of users to add to the group * - * @return ADORecordSet|int + * @return int|string */ public function createGroup($groname, $users) { @@ -868,7 +870,7 @@ trait RoleTrait * * @param string $groname The name of the group to drop * - * @return ADORecordSet|int + * @return int|string */ public function dropGroup($groname) { @@ -1029,7 +1031,7 @@ trait RoleTrait * @param mixed $inherits * @param mixed $login * - * @return int|ADORecordSet + * @return int|string */ private function _alterRole($rolename, $password, $connlimit, $expiry, $superuser, $createdb, $createrole, $inherits, $login) { |