Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/provisioning_api/lib/Controller/GroupsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ public function __construct(
#[NoAdminRequired]
public function getGroups(string $search = '', ?int $limit = null, int $offset = 0): DataResponse {
$groups = $this->groupManager->search($search, $limit, $offset);
$groups = array_values(array_map(function ($group) {
$groups = array_map(function ($group) {
/** @var IGroup $group */
return $group->getGID();
}, $groups));
}, $groups);

return new DataResponse(['groups' => $groups]);
}
Expand All @@ -101,7 +101,7 @@ public function getGroups(string $search = '', ?int $limit = null, int $offset =
#[AuthorizedAdminSetting(settings: Users::class)]
public function getGroupsDetails(string $search = '', ?int $limit = null, int $offset = 0): DataResponse {
$groups = $this->groupManager->search($search, $limit, $offset);
$groups = array_values(array_map(function ($group) {
$groups = array_map(function ($group) {
/** @var IGroup $group */
return [
'id' => $group->getGID(),
Expand All @@ -111,7 +111,7 @@ public function getGroupsDetails(string $search = '', ?int $limit = null, int $o
'canAdd' => $group->canAddUser(),
'canRemove' => $group->canRemoveUser(),
];
}, $groups));
}, $groups);

return new DataResponse(['groups' => $groups]);
}
Expand Down
2 changes: 0 additions & 2 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3701,8 +3701,6 @@
<file src="lib/private/Group/Manager.php">
<LessSpecificReturnStatement>
<code><![CDATA[$groups]]></code>
<code><![CDATA[array_values($groups)]]></code>
<code><![CDATA[array_values($groups)]]></code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType>
<code><![CDATA[\OC\Group\Group[]]]></code>
Expand Down
6 changes: 0 additions & 6 deletions lib/private/Group/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,6 @@ public function createGroup($gid) {
}
}

/**
* @param string $search
* @param ?int $limit
* @param ?int $offset
* @return \OC\Group\Group[]
*/
public function search(string $search, ?int $limit = null, ?int $offset = 0) {
$groups = [];
foreach ($this->backends as $backend) {
Expand Down
8 changes: 0 additions & 8 deletions lib/private/User/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,6 @@ public function search($pattern, $limit = null, $offset = null) {
return $users;
}

/**
* Search by displayName
*
* @param string $pattern
* @param int $limit
* @param int $offset
* @return IUser[]
*/
public function searchDisplayName($pattern, $limit = null, $offset = null) {
$users = [];
foreach ($this->backends as $backend) {
Expand Down
2 changes: 1 addition & 1 deletion lib/public/IGroupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function createGroup($gid);
* @param string $search
* @param ?int $limit
* @param ?int $offset
* @return \OCP\IGroup[]
* @return list<IGroup>
* @since 8.0.0
*/
public function search(string $search, ?int $limit = null, ?int $offset = 0);
Expand Down
2 changes: 1 addition & 1 deletion lib/public/IUserManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function search($pattern, $limit = null, $offset = null);
* @param string $pattern
* @param int $limit
* @param int $offset
* @return \OCP\IUser[]
* @return list<IUser>
* @since 8.0.0
*/
public function searchDisplayName($pattern, $limit = null, $offset = null);
Expand Down
Loading