Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
chore: Update baseline and fix stubs
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Apr 14, 2025
commit 3f2ac226889cd6fa7807d1d3f480e31ffe5849ac
11 changes: 6 additions & 5 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\L10N\IFactory;
use OCP\Server;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use Throwable;
Expand Down Expand Up @@ -78,12 +79,12 @@ public function boot(IBootContext $context): void {
CsrfTokenManager $csrfTokenManager,
bool $isCLI,
) {
$groupBackend = \OC::$server->get(GroupBackend::class);
\OC::$server->get(IGroupManager::class)->addBackend($groupBackend);
$groupBackend = Server::get(GroupBackend::class);
Server::get(IGroupManager::class)->addBackend($groupBackend);

$samlSettings = \OC::$server->get(SAMLSettings::class);
$samlSettings = Server::get(SAMLSettings::class);

$userBackend = \OCP\Server::get(UserBackend::class);
$userBackend = Server::get(UserBackend::class);

$userBackend->registerBackends($userManager->getBackends());
OC_User::useBackend($userBackend);
Expand Down Expand Up @@ -212,7 +213,7 @@ public function boot(IBootContext $context): void {
}
});
} catch (Throwable $e) {
\OCP\Server::get(LoggerInterface::class)->critical('Error when loading user_saml app', [
Server::get(LoggerInterface::class)->critical('Error when loading user_saml app', [
'exception' => $e,
]);
}
Expand Down
12 changes: 0 additions & 12 deletions tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@
-->
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
<file src="lib/AppInfo/Application.php">
<DeprecatedMethod>
<code><![CDATA[registerMiddleWare]]></code>
<code><![CDATA[registerService]]></code>
<code><![CDATA[registerService]]></code>
</DeprecatedMethod>
<MissingDependency>
<code><![CDATA[DavPlugin]]></code>
<code><![CDATA[DavPlugin]]></code>
<code><![CDATA[DavPlugin]]></code>
</MissingDependency>
</file>
<file src="lib/Controller/SAMLController.php">
Expand All @@ -33,12 +27,7 @@
<code><![CDATA[ClientFlowLoginV2Controller]]></code>
<code><![CDATA[ClientFlowLoginV2Controller]]></code>
<code><![CDATA[ClientFlowLoginV2Controller]]></code>
<code><![CDATA[CsrfTokenManager]]></code>
</UndefinedClass>
<UndefinedDocblockClass>
<code><![CDATA[$csrfTokenManager]]></code>
<code><![CDATA[$csrfTokenManager]]></code>
</UndefinedDocblockClass>
</file>
<file src="lib/DavPlugin.php">
<UndefinedClass>
Expand Down Expand Up @@ -88,7 +77,6 @@
<code><![CDATA[$offset]]></code>
</InvalidArgument>
<UndefinedClass>
<code><![CDATA[CsrfTokenManager]]></code>
<code><![CDATA[\OC]]></code>
<code><![CDATA[\OC]]></code>
</UndefinedClass>
Expand Down
25 changes: 10 additions & 15 deletions tests/stub.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,28 @@ namespace OC\DB\Exceptions {
}
}
}
namespace OC\Security\CSRF {
class CsrfToken {
public function getEncryptedValue(): string {
return 'token';
}
}
}

namespace OCP\Log {
public function logger(?string $appId = null): \Psr\Log\LoggerInterface;
}

namespace OC\Security\CSRF {
class CsrfToken {
public function getEncryptedValue(): string {
return 'token';
}
}
class CsrfTokenManager {
abstract public function getToken(): CsrfToken;
}
}

class OC {
static $WEBROOT = '';
}

class \OC_Util {
public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) {}
namespace OC\User {
class LoginException extends \Exception {
}
}

class OC_User {
static function useBackend($userBackend) {}
static function handleApacheAuth() {}
public static function useBackend($userBackend): void;
public static function handleApacheAuth(): void;
}
Loading