Skip to content

Commit 63f7d10

Browse files
authored
feature KnpLabs#984 Add deprecations to the PR review methods to allow cleanup (acrobat)
This PR was merged into the 3.2.x-dev branch. Discussion ---------- Fixes KnpLabs#621 This PR adds some deprecations so we can cleanup these classes (unused parameters/methods) in 4.0. Commits ------- 0f1f10f Add deprecations to the PR review methods to allow cleanup
2 parents af89959 + 0f1f10f commit 63f7d10

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

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)