Skip to content

Commit b4e4ed7

Browse files
Add more return types
1 parent a3f2557 commit b4e4ed7

29 files changed

+45
-42
lines changed

tests/Api/DeployKeysTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function shouldGetAllDeployKeys(): void
3434
$this->assertEquals($expectedArray, $api->all(['page' => 2, 'per_page' => 5]));
3535
}
3636

37-
protected function getMultipleDeployKeysData()
37+
protected function getMultipleDeployKeysData(): array
3838
{
3939
return [
4040
[
@@ -52,7 +52,7 @@ protected function getMultipleDeployKeysData()
5252
];
5353
}
5454

55-
protected function getApiClass()
55+
protected function getApiClass(): string
5656
{
5757
return DeployKeys::class;
5858
}

tests/Api/DeploymentsTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
use Gitlab\Api\Deployments;
1818
use PHPUnit\Framework\Attributes\Test;
19+
use PHPUnit\Framework\MockObject\MockObject;
1920

2021
class DeploymentsTest extends TestCase
2122
{
@@ -107,7 +108,7 @@ public function shouldShowDeployment(): void
107108
$this->assertEquals($expectedArray, $api->show(1, 42));
108109
}
109110

110-
private function getMultipleDeploymentsData()
111+
private function getMultipleDeploymentsData(): array
111112
{
112113
return [
113114
[
@@ -241,7 +242,7 @@ private function getMultipleDeploymentsData()
241242
];
242243
}
243244

244-
protected function getMultipleDeploymentsRequestMock(string $path, array $expectedArray, array $expectedParameters)
245+
protected function getMultipleDeploymentsRequestMock(string $path, array $expectedArray, array $expectedParameters): MockObject
245246
{
246247
$api = $this->getApiMock();
247248
$api->expects($this->once())
@@ -269,7 +270,7 @@ public function shouldGetAllDeploymentsSortedByCreatedAt(): void
269270
);
270271
}
271272

272-
protected function getApiClass()
273+
protected function getApiClass(): string
273274
{
274275
return Deployments::class;
275276
}

tests/Api/EnvironmentsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function shouldStopEnvironment(): void
195195
$this->assertEquals($expectedBool, $api->stop(1, 3));
196196
}
197197

198-
protected function getApiClass()
198+
protected function getApiClass(): string
199199
{
200200
return Environments::class;
201201
}

tests/Api/EventsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class EventsTest extends TestCase
2020
{
21-
protected function getApiClass()
21+
protected function getApiClass(): string
2222
{
2323
return Events::class;
2424
}

tests/Api/GroupBoardsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public function shouldDeleteList(): void
218218
$this->assertEquals($expectedBool, $api->deleteList(1, 2, 3));
219219
}
220220

221-
protected function getApiClass()
221+
protected function getApiClass(): string
222222
{
223223
return GroupsBoards::class;
224224
}

tests/Api/GroupsEpicsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function shouldGetEpicsIssues(): void
114114
$this->assertEquals($expectedArray, $api->issues(1, 2));
115115
}
116116

117-
protected function getApiClass()
117+
protected function getApiClass(): string
118118
{
119119
return GroupsEpics::class;
120120
}

tests/Api/GroupsMilestonesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function shouldGetAllMilestonesWithParameterTwoIidsValues(): void
6262
$api->all(1, ['iids' => [456, 789]]);
6363
}
6464

65-
public static function getAllMilestonesWithParameterStateDataProvider()
65+
public static function getAllMilestonesWithParameterStateDataProvider(): array
6666
{
6767
return [
6868
GroupsMilestones::STATE_ACTIVE => [GroupsMilestones::STATE_ACTIVE],
@@ -220,7 +220,7 @@ public function shouldGetMilestonesMergeRequests(): void
220220
$this->assertEquals($expectedArray, $api->mergeRequests(1, 3));
221221
}
222222

223-
protected function getApiClass()
223+
protected function getApiClass(): string
224224
{
225225
return GroupsMilestones::class;
226226
}

tests/Api/GroupsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ public function shouldRemoveVariable(): void
534534
$this->assertEquals($expectedBool, $api->removeVariable(1, 'ftp_password'));
535535
}
536536

537-
protected function getApiClass()
537+
protected function getApiClass(): string
538538
{
539539
return Groups::class;
540540
}

tests/Api/IssueBoardsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public function shouldDeleteList(): void
218218
$this->assertEquals($expectedBool, $api->deleteList(1, 2, 3));
219219
}
220220

221-
protected function getApiClass()
221+
protected function getApiClass(): string
222222
{
223223
return IssueBoards::class;
224224
}

tests/Api/IssueLinksTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class IssueLinksTest extends TestCase
2222
/**
2323
* {@inheritdoc}
2424
*/
25-
protected function getApiClass()
25+
protected function getApiClass(): string
2626
{
2727
return IssueLinks::class;
2828
}

0 commit comments

Comments
 (0)