update 2023-07-26 12:22:59

This commit is contained in:
Robot 2023-07-26 12:22:59 +02:00
parent c54ac03fa8
commit 362e4654cd
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
5 changed files with 27 additions and 14 deletions

View File

@ -830,7 +830,6 @@ class Repository implements ServiceProviderInterface
$container->get('Gitea.Dynamic.Uri'),
$container->get('Gitea.Utilities.Response')
);
}
}
}

View File

@ -767,4 +767,4 @@
$container->get('Gitea.Dynamic.Uri'),
$container->get('Gitea.Utilities.Response')
);
}
}

View File

@ -15,7 +15,7 @@ abstract Api #Orange {
# Uri $uri
# Response $response
+ __construct(Http $http, Uri $uri, ...)
+ load_(string $url, string $token) : void
+ load_(?string $url = null, ?string $token = null) : void
}
note right of Api::__construct

View File

@ -67,16 +67,23 @@ abstract class Api
/**
* Load/Reload API.
*
* @param string $url The url.
* @param token $token The token.
* @param string|null $url The url.
* @param token|null $token The token.
*
* @return void
* @since 3.2.0
**/
public function load_(string $url, string $token)
public function load_(?string $url = null, ?string $token = null)
{
$this->uri->setUrl($url);
$this->http->setToken($token);
if ($url !== null)
{
$this->uri->setUrl($url);
}
if ($token !== null)
{
$this->http->setToken($token);
}
}
}

View File

@ -41,14 +41,21 @@
/**
* Load/Reload API.
*
* @param string $url The url.
* @param token $token The token.
* @param string|null $url The url.
* @param token|null $token The token.
*
* @return void
* @since 3.2.0
**/
public function load_(string $url, string $token)
public function load_(?string $url = null, ?string $token = null)
{
$this->uri->setUrl($url);
$this->http->setToken($token);
if ($url !== null)
{
$this->uri->setUrl($url);
}
if ($token !== null)
{
$this->http->setToken($token);
}
}