Skip to content

Commit 0f1f10f

Browse files
committed
Add deprecations to the PR review methods to allow cleanup
1 parent 7b84f9c commit 0f1f10f

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"psr/http-client-implementation": "^1.0",
2929
"psr/http-factory-implementation": "^1.0",
3030
"psr/http-message": "^1.0",
31-
"symfony/polyfill-php80": "^1.17"
31+
"symfony/polyfill-php80": "^1.17",
32+
"symfony/deprecation-contracts": "^2.2"
3233
},
3334
"require-dev": {
3435
"symfony/cache": "^5.1.8",

lib/Github/Api/PullRequest/Review.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class Review extends AbstractApi
2020

2121
public function configure()
2222
{
23+
trigger_deprecation('KnpLabs/php-github-api', '3.2', 'The "%s" is deprecated and will be removed.', __METHOD__);
24+
2325
return $this;
2426
}
2527

@@ -37,6 +39,10 @@ public function configure()
3739
*/
3840
public function all($username, $repository, $pullRequest, array $params = [])
3941
{
42+
if (!empty($params)) {
43+
trigger_deprecation('KnpLabs/php-github-api', '3.2', 'The "$params" parameter is deprecated, to paginate the results use the "ResultPager" instead.');
44+
}
45+
4046
$parameters = array_merge([
4147
'page' => 1,
4248
'per_page' => 30,

lib/Github/Api/PullRequest/ReviewRequest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class ReviewRequest extends AbstractApi
1414

1515
public function configure()
1616
{
17+
trigger_deprecation('KnpLabs/php-github-api', '3.2', 'The "%s" is deprecated and will be removed.', __METHOD__);
18+
1719
return $this;
1820
}
1921

@@ -29,6 +31,10 @@ public function configure()
2931
*/
3032
public function all($username, $repository, $pullRequest, array $params = [])
3133
{
34+
if (!empty($params)) {
35+
trigger_deprecation('KnpLabs/php-github-api', '3.2', 'The "$params" parameter is deprecated, to paginate the results use the "ResultPager" instead.');
36+
}
37+
3238
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/requested_reviewers', $params);
3339
}
3440

0 commit comments

Comments
 (0)