Restructure HTTPClient for new paradigm

This commit is contained in:
Philipp 2021-10-23 12:50:29 +02:00
parent 6bc61d5ef7
commit fe296e5a73
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
4 changed files with 26 additions and 26 deletions

View file

@ -5,8 +5,8 @@ namespace Friendica\Addon\webdav_storage\src;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\Storage\Capability\ICanConfigureStorage;
use Friendica\Network\HTTPClientOptions;
use Friendica\Network\IHTTPClient;
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Network\HTTPClient\Capability\ICanRequestPerHttp;
/**
* The WebDav Backend Storage configuration class
@ -24,7 +24,7 @@ class WebDavConfig implements ICanConfigureStorage
/** @var string */
private $url;
/** @var IHTTPClient */
/** @var \Friendica\Network\HTTPClient\Capability\ICanRequestPerHttp */
private $client;
/** @var array */
@ -46,7 +46,7 @@ class WebDavConfig implements ICanConfigureStorage
return $this->authOptions;
}
public function __construct(L10n $l10n, IManageConfigValues $config, IHTTPClient $client)
public function __construct(L10n $l10n, IManageConfigValues $config, ICanRequestPerHttp $client)
{
$this->l10n = $l10n;
$this->config = $config;
@ -138,7 +138,7 @@ class WebDavConfig implements ICanConfigureStorage
];
}
if (!$this->client->head($url, [HTTPClientOptions::AUTH => $options])->isSuccess()) {
if (!$this->client->head($url, [HttpClientOptions::AUTH => $options])->isSuccess()) {
return [
'url' => $this->l10n->t('url is either invalid or not reachable'),
];