Skip to content

Commit 3f2ac22

Browse files
committed
chore: Update baseline and fix stubs
Signed-off-by: Côme Chilliet <[email protected]>
1 parent 224f5c9 commit 3f2ac22

File tree

3 files changed

+16
-32
lines changed

3 files changed

+16
-32
lines changed

lib/AppInfo/Application.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use OCP\IUserManager;
3636
use OCP\IUserSession;
3737
use OCP\L10N\IFactory;
38+
use OCP\Server;
3839
use Psr\Container\ContainerInterface;
3940
use Psr\Log\LoggerInterface;
4041
use Throwable;
@@ -78,12 +79,12 @@ public function boot(IBootContext $context): void {
7879
CsrfTokenManager $csrfTokenManager,
7980
bool $isCLI,
8081
) {
81-
$groupBackend = \OC::$server->get(GroupBackend::class);
82-
\OC::$server->get(IGroupManager::class)->addBackend($groupBackend);
82+
$groupBackend = Server::get(GroupBackend::class);
83+
Server::get(IGroupManager::class)->addBackend($groupBackend);
8384

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

86-
$userBackend = \OCP\Server::get(UserBackend::class);
87+
$userBackend = Server::get(UserBackend::class);
8788

8889
$userBackend->registerBackends($userManager->getBackends());
8990
OC_User::useBackend($userBackend);
@@ -212,7 +213,7 @@ public function boot(IBootContext $context): void {
212213
}
213214
});
214215
} catch (Throwable $e) {
215-
\OCP\Server::get(LoggerInterface::class)->critical('Error when loading user_saml app', [
216+
Server::get(LoggerInterface::class)->critical('Error when loading user_saml app', [
216217
'exception' => $e,
217218
]);
218219
}

tests/psalm-baseline.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@
55
-->
66
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
77
<file src="lib/AppInfo/Application.php">
8-
<DeprecatedMethod>
9-
<code><![CDATA[registerMiddleWare]]></code>
10-
<code><![CDATA[registerService]]></code>
11-
<code><![CDATA[registerService]]></code>
12-
</DeprecatedMethod>
138
<MissingDependency>
149
<code><![CDATA[DavPlugin]]></code>
1510
<code><![CDATA[DavPlugin]]></code>
16-
<code><![CDATA[DavPlugin]]></code>
1711
</MissingDependency>
1812
</file>
1913
<file src="lib/Controller/SAMLController.php">
@@ -33,12 +27,7 @@
3327
<code><![CDATA[ClientFlowLoginV2Controller]]></code>
3428
<code><![CDATA[ClientFlowLoginV2Controller]]></code>
3529
<code><![CDATA[ClientFlowLoginV2Controller]]></code>
36-
<code><![CDATA[CsrfTokenManager]]></code>
3730
</UndefinedClass>
38-
<UndefinedDocblockClass>
39-
<code><![CDATA[$csrfTokenManager]]></code>
40-
<code><![CDATA[$csrfTokenManager]]></code>
41-
</UndefinedDocblockClass>
4231
</file>
4332
<file src="lib/DavPlugin.php">
4433
<UndefinedClass>
@@ -88,7 +77,6 @@
8877
<code><![CDATA[$offset]]></code>
8978
</InvalidArgument>
9079
<UndefinedClass>
91-
<code><![CDATA[CsrfTokenManager]]></code>
9280
<code><![CDATA[\OC]]></code>
9381
<code><![CDATA[\OC]]></code>
9482
</UndefinedClass>

tests/stub.phpstub

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,33 +48,28 @@ namespace OC\DB\Exceptions {
4848
}
4949
}
5050
}
51-
namespace OC\Security\CSRF {
52-
class CsrfToken {
53-
public function getEncryptedValue(): string {
54-
return 'token';
55-
}
56-
}
57-
}
5851

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

6356
namespace OC\Security\CSRF {
57+
class CsrfToken {
58+
public function getEncryptedValue(): string {
59+
return 'token';
60+
}
61+
}
6462
class CsrfTokenManager {
6563
abstract public function getToken(): CsrfToken;
6664
}
6765
}
6866

69-
class OC {
70-
static $WEBROOT = '';
71-
}
72-
73-
class \OC_Util {
74-
public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) {}
67+
namespace OC\User {
68+
class LoginException extends \Exception {
69+
}
7570
}
7671

7772
class OC_User {
78-
static function useBackend($userBackend) {}
79-
static function handleApacheAuth() {}
73+
public static function useBackend($userBackend): void;
74+
public static function handleApacheAuth(): void;
8075
}

0 commit comments

Comments
 (0)