1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

Merge pull request #825 from Zankaria/context-fix

context.php: fix missing include file
This commit is contained in:
Lorenzo Yario 2024-10-20 12:03:51 -07:00 committed by GitHub
commit d6677bb90c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,8 +1,7 @@
<?php
namespace Vichan;
use RuntimeException;
use Vichan\Data\Driver\{HttpDriver, ErrorLogLogDriver, FileLogDriver, LogDriver, StderrLogDriver, SyslogLogDriver};
use Vichan\Data\Driver\{CacheDriver, HttpDriver, ErrorLogLogDriver, FileLogDriver, LogDriver, StderrLogDriver, SyslogLogDriver};
use Vichan\Service\HCaptchaQuery;
use Vichan\Service\NativeCaptchaQuery;
use Vichan\Service\ReCaptchaQuery;
@ -19,7 +18,7 @@ class Context {
public function get(string $name): mixed {
if (!isset($this->definitions[$name])) {
throw new RuntimeException("Could not find a dependency named $name");
throw new \RuntimeException("Could not find a dependency named $name");
}
$ret = $this->definitions[$name];
@ -69,13 +68,13 @@ function build_context(array $config): Context {
$config['captcha']['hcaptcha']['sitekey']
);
default:
throw new RuntimeException('No remote captcha service available');
throw new \RuntimeException('No remote captcha service available');
}
},
NativeCaptchaQuery::class => function($c) {
$config = $c->get('config');
if ($config['captcha']['provider'] !== 'native') {
throw new RuntimeException('No native captcha service available');
throw new \RuntimeException('No native captcha service available');
}
return new NativeCaptchaQuery(
$c->get(HttpDriver::class),