Skip to content

Commit

Permalink
fixup! Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlSchwan committed May 30, 2022
1 parent 4f860a3 commit 4a60577
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 50 deletions.
2 changes: 1 addition & 1 deletion apps/user_ldap/lib/Group_LDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

class Group_LDAP extends ABackend implements GroupInterface, IGroupLDAP,
IGetDisplayNameBackend, IDeleteGroupBackend, ICountUsersBackend, IAddToGroupBackend,
IRemoveFromGroupBackend, IGroupDetailsBackend {
IRemoveFromGroupBackend {
protected $enabled = false;

/** @var CappedMemoryCache<string[]> $cachedGroupMembers array of users with gid as key */
Expand Down
5 changes: 3 additions & 2 deletions apps/user_ldap/lib/Group_Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

class Group_Proxy extends Proxy implements GroupInterface, IGroupLDAP,
IGetDisplayNameBackend, IDeleteGroupBackend, ICountUsersBackend, IAddToGroupBackend,
IRemoveFromGroupBackend, IGroupDetailsBackend {
IRemoveFromGroupBackend {
private $backends = [];
private $refBackend = null;

Expand Down Expand Up @@ -280,9 +280,10 @@ public function implementsActions($actions) {
/**
* Return access for LDAP interaction.
*
* @param string $gid
* @return Access instance of Access for LDAP interaction
*/
public function getLDAPAccess($gid) {
public function getLDAPAccess($gid): Acc {
return $this->handleRequest($gid, 'getLDAPAccess', [$gid]);
}

Expand Down
45 changes: 0 additions & 45 deletions build/psalm-baseline-ocp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,6 @@
<code>\OC</code>
</UndefinedClass>
</file>
<file src="lib/public/AppFramework/Http/ZipResponse.php">
<InvalidArrayAccess occurrences="5">
<code>$resource['internalName']</code>
<code>$resource['resource']</code>
<code>$resource['size']</code>
<code>$resource['size']</code>
<code>$resource['time']</code>
</InvalidArrayAccess>
<InvalidPropertyAssignmentValue occurrences="1">
<code>$this-&gt;resources</code>
</InvalidPropertyAssignmentValue>
</file>
<file src="lib/public/BackgroundJob/Job.php">
<UndefinedClass occurrences="1">
<code>\OC</code>
Expand Down Expand Up @@ -169,16 +157,6 @@
<code>\OC</code>
</UndefinedClass>
</file>
<file src="lib/public/FullTextSearch/Model/ISearchRequest.php">
<InvalidClass occurrences="1">
<code>IsearchRequest</code>
</InvalidClass>
</file>
<file src="lib/public/IAddressBook.php">
<InvalidDocblock occurrences="1">
<code>public function getUri(): string;</code>
</InvalidDocblock>
</file>
<file src="lib/public/IAvatar.php">
<UndefinedDocblockClass occurrences="1">
<code>Color</code>
Expand All @@ -190,23 +168,6 @@
<code>ContainerExceptionInterface</code>
</InvalidThrow>
</file>
<file src="lib/public/IDBConnection.php">
<InvalidClass occurrences="1">
<code>PreconditionNotMetException</code>
</InvalidClass>
</file>
<file src="lib/public/Search/SearchResult.php">
<InvalidArgument occurrences="1">
<code>$cursor</code>
</InvalidArgument>
</file>
<file src="lib/public/Share.php">
<InvalidReturnType occurrences="3">
<code>array</code>
<code>array|bool</code>
<code>mixed</code>
</InvalidReturnType>
</file>
<file src="lib/public/Template.php">
<UndefinedFunction occurrences="7">
<code>\html_select_options($options, $selected, $params)</code>
Expand All @@ -219,12 +180,6 @@
</UndefinedFunction>
</file>
<file src="lib/public/Util.php">
<InvalidReturnStatement occurrences="1">
<code>\OC_Helper::computerFileSize($str)</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
<code>float</code>
</InvalidReturnType>
<UndefinedClass occurrences="14">
<code>\OC</code>
<code>\OC</code>
Expand Down
5 changes: 3 additions & 2 deletions lib/public/Group/Backend/ABackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use OC\User\LazyUser;
use OCP\GroupInterface;
use OCP\IUserManager;
use OCP\Server;

/**
* @since 14.0.0
Expand Down Expand Up @@ -71,8 +72,8 @@ public function implementsActions($actions): bool {

public function searchInGroup(string $gid, string $search = '', int $limit = -1, int $offset = 0): array {
// Default implementation for compatibility reasons
$displayNameCache = \OC::$server->get(DisplayNameCache::class);
$userManager = \OC::$server->get(IUserManager::class);
$displayNameCache = Server::get(DisplayNameCache::class);
$userManager = Server::get(IUserManager::class);
$users = [];
foreach ($this->usersInGroup($gid, $search, $limit, $offset) as $userId) {
$users[$userId] = new LazyUser($userId, $displayNameCache, $userManager);
Expand Down

0 comments on commit 4a60577

Please sign in to comment.