diff --git a/src/8d1baef6-fcad-49a9-848f-428009cdb989/README.md b/src/8d1baef6-fcad-49a9-848f-428009cdb989/README.md index 37bd2d6..6315f67 100644 --- a/src/8d1baef6-fcad-49a9-848f-428009cdb989/README.md +++ b/src/8d1baef6-fcad-49a9-848f-428009cdb989/README.md @@ -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 diff --git a/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.php b/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.php index 3f2476b..3ba26d3 100644 --- a/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.php +++ b/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.php @@ -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 diff --git a/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.power b/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.power index a07223a..abbfadb 100644 --- a/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.power +++ b/src/8d1baef6-fcad-49a9-848f-428009cdb989/code.power @@ -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 diff --git a/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.php b/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.php index ea65e1c..3529cac 100644 --- a/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.php +++ b/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.php @@ -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); diff --git a/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.power b/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.power index 238f687..549671f 100644 --- a/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.power +++ b/src/ce40b3d2-226c-4a64-b116-c19455822be1/code.power @@ -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);