Skip to content

Commit

Permalink
Merge branch 'KnpLabs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mruell authored Apr 13, 2022
2 parents a1f9686 + 1f31aa1 commit 74a46ee
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 22 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG-3.X.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 3.6.0

### Added
- Include optional params parameter for Commits compare method ([mountiny](https://github.com/mountiny)) [#1053](https://github.com/KnpLabs/php-github-api/issues/1053)

### Changed
- Update incorrect documentation ([pheeque1](https://github.com/pheeque1)) [#1058](https://github.com/KnpLabs/php-github-api/issues/1058)

### Fixed
- fix(Apps): use /orgs/ORG/installation ([ellisio](https://github.com/ellisio)) [#1056](https://github.com/KnpLabs/php-github-api/issues/1056)

## 3.5.1

### Fixed
- Boolean private needed to create private repo! ([mruell](https://github.com/mruell)) [#1051](https://github.com/KnpLabs/php-github-api/issues/1051)

## 3.5.0

### Added
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"composer/package-versions-deprecated": true
}
}
}
6 changes: 1 addition & 5 deletions doc/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ Wrap [GitHub User API](http://developer.github.com/v3/users/).

### Search for users by keyword

```php
$users = $client->api('user')->find('KnpLabs');
```

Returns an array of found users.
Use the [Search API](https://github.com/KnpLabs/php-github-api/blob/master/doc/search.md#search-users) to find users by keyword.

### Lists all users, in the order they signed up, since the last user you've seen

Expand Down
2 changes: 1 addition & 1 deletion lib/Github/Api/Apps.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function getInstallationForOrganization($org)
{
$this->configurePreviewHeader();

return $this->get('/org/'.rawurldecode($org).'/installation');
return $this->get('/orgs/'.rawurldecode($org).'/installation');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/Github/Api/PullRequest/ReviewRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public function all($username, $repository, $pullRequest, array $params = [])
}

/**
* @link https://developer.github.com/v3/pulls/review_requests/#create-a-review-request
* @link https://docs.github.com/en/rest/reference/pulls#request-reviewers-for-a-pull-request
*
* @param string $username
* @param string $repository
* @param int $pullRequest
* @param array $reviewers
* @param array $teamReviewers
*
* @return string
* @return array
*/
public function create($username, $repository, $pullRequest, array $reviewers = [], array $teamReviewers = [])
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Github/Api/Repository/Commits.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public function all($username, $repository, array $params)
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits', $params);
}

public function compare($username, $repository, $base, $head, $mediaType = null)
public function compare($username, $repository, $base, $head, $mediaType = null, array $params = [])
{
$headers = [];
if (null !== $mediaType) {
$headers['Accept'] = $mediaType;
}

return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/compare/'.rawurlencode($base).'...'.rawurlencode($head), [], $headers);
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/compare/'.rawurlencode($base).'...'.rawurlencode($head), $params, $headers);
}

public function show($username, $repository, $sha)
Expand Down
2 changes: 1 addition & 1 deletion test/Github/Tests/Api/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function shouldGetInstallationForOrganization()
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('/org/1234/installation')
->with('/orgs/1234/installation')
->willReturn($result);

$this->assertEquals($result, $api->getInstallationForOrganization('1234'));
Expand Down
15 changes: 5 additions & 10 deletions test/Github/Tests/HttpClient/Message/ResponseMediatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,13 @@ public function testGetContentInvalidJson()

public function testGetPagination()
{
$header = <<<'TEXT'
<http://github.com>; rel="first",
<http://github.com>; rel="next",
<http://github.com>; rel="prev",
<http://github.com>; rel="last",
TEXT;
$header = '<https://github.com>; rel="first",<https://github.com>; rel="next",<https://github.com>; rel="prev",<https://github.com>; rel="last",';

$pagination = [
'first' => 'http://github.com',
'next' => 'http://github.com',
'prev' => 'http://github.com',
'last' => 'http://github.com',
'first' => 'https://github.com',
'next' => 'https://github.com',
'prev' => 'https://github.com',
'last' => 'https://github.com',
];

// response mock
Expand Down

0 comments on commit 74a46ee

Please sign in to comment.