Skip to content

Commit

Permalink
Ignore psalm in this cases
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen authored and backportbot[bot] committed Feb 18, 2022
1 parent ab74cde commit 3302112
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,28 @@ public function __construct() {
parent::__construct(self::APP_ID);
}

/**
* @psalm-suppress UndefinedClass
*/
public function register(IRegistrationContext $context): void {
$context->registerService('ActivityDBConnection', function (ContainerInterface $c) {
$systemConfig = $c->get(SystemConfig::class);
$factory = new \OC\DB\ConnectionFactory($systemConfig);
$type = $systemConfig->getValue('dbtype', 'sqlite');
if (!$factory->isValidType($type)) {
/** @psalm-suppress InvalidThrow */
throw new \OC\DatabaseException('Invalid database type');
}
$connectionParams = $factory->createConnectionParams('activity_');
$connection = $factory->getConnection($type, $connectionParams);
/** @psalm-suppress MissingDependency */
$connection->getConfiguration()->setSQLLogger($c->get(\OCP\Diagnostics\IQueryLogger::class));
return $connection;
});

/**
* @psalm-suppress UndefinedClass
*/
$context->registerService('ActivityConnectionAdapter', function (ContainerInterface $c) {
$systemConfig = $c->get(SystemConfig::class);
$configPrefix = 'activity_';
Expand Down

0 comments on commit 3302112

Please sign in to comment.