Browse Source

add more typehints

Signed-off-by: Robin Appelman <robin@icewind.nl>
tags/v13.0.0beta2
Robin Appelman 6 years ago
parent
commit
8b01176f60
No account linked to committer's email address

+ 1
- 0
lib/private/Remote/Api/ApiBase.php View File

@@ -57,6 +57,7 @@ class ApiBase {
* @param array $query
* @param array $headers
* @return resource|string
* @throws \InvalidArgumentException
*/
protected function request($method, $url, array $body = [], array $query = [], array $headers = []) {
$fullUrl = trim($this->instance->getFullUrl(), '/') . '/' . $url;

+ 3
- 0
lib/private/Remote/Api/ApiCollection.php View File

@@ -28,8 +28,11 @@ use OCP\Remote\ICredentials;
use OCP\Remote\IInstance;

class ApiCollection implements IApiCollection {
/** @var IInstance */
private $instance;
/** @var ICredentials */
private $credentials;
/** @var IClientService */
private $clientService;

public function __construct(IInstance $instance, ICredentials $credentials, IClientService $clientService) {

+ 1
- 0
lib/private/Remote/Api/ApiFactory.php View File

@@ -28,6 +28,7 @@ use OCP\Remote\ICredentials;
use OCP\Remote\IInstance;

class ApiFactory implements IApiFactory {
/** @var IClientService */
private $clientService;

public function __construct(IClientService $clientService) {

+ 9
- 0
lib/private/Remote/Instance.php View File

@@ -39,6 +39,7 @@ class Instance implements IInstance {
/** @var IClientService */
private $clientService;

/** @var array|null */
private $status;

/**
@@ -93,6 +94,10 @@ class Instance implements IInstance {
return $status['installed'] && !$status['maintenance'];
}

/**
* @return array
* @throws NotFoundException
*/
private function getStatus() {
if ($this->status) {
return $this->status;
@@ -120,6 +125,10 @@ class Instance implements IInstance {
return $status;
}

/**
* @param string $url
* @return bool|string
*/
private function downloadStatus($url) {
try {
$request = $this->clientService->newClient()->get($url);

+ 2
- 0
lib/private/Remote/InstanceFactory.php View File

@@ -27,7 +27,9 @@ use OCP\ICache;
use OCP\Remote\IInstanceFactory;

class InstanceFactory implements IInstanceFactory {
/** @var ICache */
private $cache;
/** @var IClientService */
private $clientService;

public function __construct(ICache $cache, IClientService $clientService) {

+ 1
- 1
lib/public/Remote/IInstanceFactory.php View File

@@ -26,7 +26,7 @@ namespace OCP\Remote;
*/
interface IInstanceFactory {
/**
* @param $url
* @param string $url
* @return IInstance
*
* @since 13.0.0

Loading…
Cancel
Save