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 committed Feb 22, 2022
1 parent 3196583 commit 49eccb4
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 @@ -60,20 +60,28 @@ public function __construct(array $params = []) {
parent::__construct(self::APP_ID, $params);
}

/**
* @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 49eccb4

Please sign in to comment.