Update 2024-07-11 23:09:12

This commit is contained in:
Robot 2024-07-08 23:09:35 +02:00
parent 94ccf47e41
commit 7d1ecf3d74
Signed by untrusted user: Robot
GPG Key ID: 14DECD44E7E1BB95
5 changed files with 17 additions and 17 deletions

View File

@ -13,7 +13,7 @@
@startuml
class Contents #Gold {
+ get(string $owner, string $repo, ...) : mixed
+ metadata(string $owner, string $repo, ...) : ?object
+ metadata(string $owner, string $repo, ...) : null|array|object
+ create(string $owner, string $repo, ...) : ?object
+ root(string $owner, string $repo, ...) : ?array
+ update(string $owner, string $repo, ...) : ?object
@ -42,7 +42,7 @@ or a list of entries if a directory.
Default the repository's default branch (usually master).
since: 3.2.0
return: ?object
return: null|array|object
arguments:
string $owner
@ -68,7 +68,7 @@ note right of Contents::create
?string $authorEmail = null
?string $committerName = null
?string $committerEmail = null
?bool $newBranch = false
?string $newBranch = null
?string $authorDate = null
?string $committerDate = null
?bool $signoff = null

View File

@ -64,10 +64,10 @@ class Contents extends Api
* @param string|null $ref Optional. The name of the commit/branch/tag.
* Default the repository's default branch (usually master).
*
* @return object|null
* @return null|array|object
* @since 3.2.0
**/
public function metadata(string $owner, string $repo, string $filepath, ?string $ref = null): ?object
public function metadata(string $owner, string $repo, string $filepath, ?string $ref = null): null|array|object
{
// Build the request path.
$path = "/repos/{$owner}/{$repo}/contents/{$filepath}";
@ -100,7 +100,7 @@ class Contents extends Api
* @param string|null $authorEmail The author's email.
* @param string|null $committerName The committer's name.
* @param string|null $committerEmail The committer's email.
* @param bool|null $newBranch Whether to create a new branch. Defaults to false.
* @param string|null $newBranch Whether to create a new branch. Defaults to null.
* @param string|null $authorDate The author's date.
* @param string|null $committerDate The committer's date.
* @param bool|null $signoff Add a Signed-off-by trailer. Defaults to null.
@ -119,7 +119,7 @@ class Contents extends Api
?string $authorEmail = null,
?string $committerName = null,
?string $committerEmail = null,
?bool $newBranch = false,
?string $newBranch = null,
?string $authorDate = null,
?string $committerDate = null,
?bool $signoff = null

View File

@ -40,10 +40,10 @@
* @param string|null $ref Optional. The name of the commit/branch/tag.
* Default the repository's default branch (usually master).
*
* @return object|null
* @return null|array|object
* @since 3.2.0
**/
public function metadata(string $owner, string $repo, string $filepath, ?string $ref = null): ?object
public function metadata(string $owner, string $repo, string $filepath, ?string $ref = null): null|array|object
{
// Build the request path.
$path = "/repos/{$owner}/{$repo}/contents/{$filepath}";
@ -76,7 +76,7 @@
* @param string|null $authorEmail The author's email.
* @param string|null $committerName The committer's name.
* @param string|null $committerEmail The committer's email.
* @param bool|null $newBranch Whether to create a new branch. Defaults to false.
* @param string|null $newBranch Whether to create a new branch. Defaults to null.
* @param string|null $authorDate The author's date.
* @param string|null $committerDate The committer's date.
* @param bool|null $signoff Add a Signed-off-by trailer. Defaults to null.
@ -95,7 +95,7 @@
?string $authorEmail = null,
?string $committerName = null,
?string $committerEmail = null,
?bool $newBranch = false,
?string $newBranch = null,
?string $authorDate = null,
?string $committerDate = null,
?bool $signoff = null

View File

@ -29,7 +29,7 @@ final class Http extends JoomlaHttp
* @var string
* @since 3.2.0
*/
protected string $_token_; // to avoid collusions (but allow swapping)
protected string $_token_; // to avoid collisions (but allow swapping)
/**
* Constructor.
@ -52,7 +52,7 @@ final class Http extends JoomlaHttp
// add the token if given
if (is_string($token))
{
$config['headers']['Authorization'] = $token;
$config['headers']['Authorization'] = 'token ' . $token;
$this->_token_ = $token;
}
@ -78,7 +78,7 @@ final class Http extends JoomlaHttp
);
// add the token
$headers['Authorization'] = $token;
$headers['Authorization'] = 'token ' . $token;
$this->_token_ = $token;
$this->setOption('headers', $headers);

View File

@ -4,7 +4,7 @@
* @var string
* @since 3.2.0
*/
protected string $_token_; // to avoid collusions (but allow swapping)
protected string $_token_; // to avoid collisions (but allow swapping)
/**
* Constructor.
@ -27,7 +27,7 @@
// add the token if given
if (is_string($token))
{
$config['headers']['Authorization'] = $token;
$config['headers']['Authorization'] = 'token ' . $token;
$this->_token_ = $token;
}
@ -53,7 +53,7 @@
);
// add the token
$headers['Authorization'] = $token;
$headers['Authorization'] = 'token ' . $token;
$this->_token_ = $token;
$this->setOption('headers', $headers);