add more typehints

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2017-10-19 13:50:27 +02:00 committed by Morris Jobke
parent 5133a31d3c
commit 8b01176f60
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
6 changed files with 17 additions and 1 deletions

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;

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) {

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) {

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);

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) {

View File

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