Skip to content

Commit f9f39af

Browse files
committed
Apply Requested Fixes
- Add rawurlencode around both the $branch and $tag parameters in matchingBranch() and matchingTag() respectively. - Add parameter type hints, and function return types for both marchingBranch() and matchingTag()
1 parent 791f563 commit f9f39af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Github/Api/GitData/References.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public function all($username, $repository)
3434
*
3535
* @return array
3636
*/
37-
public function matchingBranch($username, $repository, $branch)
37+
public function matchingBranch(string $username, string $repository, string $branch): array
3838
{
39-
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/matching-refs/heads/'.$branch);
39+
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/matching-refs/heads/'.rawurlencode($branch));
4040
}
4141

4242
/**
@@ -48,9 +48,9 @@ public function matchingBranch($username, $repository, $branch)
4848
*
4949
* @return array
5050
*/
51-
public function matchingTag($username, $repository, $tag)
51+
public function matchingTag(string $username, string $repository, string $tag): array
5252
{
53-
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/matching-refs/tags/'.$tag);
53+
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/matching-refs/tags/'.rawurlencode($tag));
5454
}
5555

5656
/**

0 commit comments

Comments
 (0)