Skip to content

Commit 952f4e2

Browse files
Added more return types
1 parent 9a67acf commit 952f4e2

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

src/Api/Groups.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function removeMember($group_id, int $user_id)
220220
public function projects($id, array $parameters = [])
221221
{
222222
$resolver = $this->createOptionsResolver();
223-
$booleanNormalizer = function (Options $resolver, $value) {
223+
$booleanNormalizer = function (Options $resolver, $value): string {
224224
return $value ? 'true' : 'false';
225225
};
226226

@@ -427,7 +427,7 @@ public function removeVariable($group_id, string $key)
427427
private function getGroupSearchResolver()
428428
{
429429
$resolver = $this->createOptionsResolver();
430-
$booleanNormalizer = function (Options $resolver, $value) {
430+
$booleanNormalizer = function (Options $resolver, $value): string {
431431
return $value ? 'true' : 'false';
432432
};
433433

src/Api/Issues.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ public function showParticipants($project_id, int $issue_iid)
432432
protected function createOptionsResolver(): OptionsResolver
433433
{
434434
$resolver = parent::createOptionsResolver();
435-
$booleanNormalizer = function (Options $resolver, $value) {
435+
$booleanNormalizer = function (Options $resolver, $value): string {
436436
return $value ? 'true' : 'false';
437437
};
438438

src/Api/IssuesStatistics.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function createOptionsResolver(): OptionsResolver
8585
$resolver->setDefined('search')
8686
->setAllowedTypes('search', 'string');
8787

88-
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value) {
88+
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value): string {
8989
return $value->format('c');
9090
};
9191

@@ -105,7 +105,7 @@ protected function createOptionsResolver(): OptionsResolver
105105
->setAllowedTypes('updated_before', \DateTimeInterface::class)
106106
->setNormalizer('updated_before', $datetimeNormalizer);
107107

108-
$booleanNormalizer = function (Options $resolver, $value) {
108+
$booleanNormalizer = function (Options $resolver, $value): string {
109109
return $value ? 'true' : 'false';
110110
};
111111

src/Api/MergeRequests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class MergeRequests extends AbstractApi
6666
public function all($project_id = null, array $parameters = [])
6767
{
6868
$resolver = $this->createOptionsResolver();
69-
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value) {
69+
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value): string {
7070
return $value->format('c');
7171
};
7272
$resolver->setDefined('iids')

src/Api/Projects.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Projects extends AbstractApi
4949
public function all(array $parameters = [])
5050
{
5151
$resolver = $this->createOptionsResolver();
52-
$booleanNormalizer = function (Options $resolver, $value) {
52+
$booleanNormalizer = function (Options $resolver, $value): string {
5353
return $value ? 'true' : 'false';
5454
};
5555
$resolver->setDefined('archived')
@@ -114,7 +114,7 @@ public function all(array $parameters = [])
114114
public function show($project_id, array $parameters = [])
115115
{
116116
$resolver = $this->createOptionsResolver();
117-
$booleanNormalizer = function (Options $resolver, $value) {
117+
$booleanNormalizer = function (Options $resolver, $value): bool {
118118
return (bool) $value;
119119
};
120120
$resolver->setDefined('statistics')
@@ -251,10 +251,10 @@ public function createTrigger($project_id, string $description)
251251
public function pipelines($project_id, array $parameters = [])
252252
{
253253
$resolver = $this->createOptionsResolver();
254-
$booleanNormalizer = function (Options $resolver, $value) {
254+
$booleanNormalizer = function (Options $resolver, $value): string {
255255
return $value ? 'true' : 'false';
256256
};
257-
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value) {
257+
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value): string {
258258
return $value->format('Y-m-d');
259259
};
260260

@@ -671,7 +671,7 @@ public function enableDeployKey($project_id, int $key_id)
671671
public function events($project_id, array $parameters = [])
672672
{
673673
$resolver = $this->createOptionsResolver();
674-
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value) {
674+
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value): string {
675675
return $value->format('Y-m-d');
676676
};
677677

@@ -977,7 +977,7 @@ public function addShare($project_id, array $parameters = [])
977977
{
978978
$resolver = $this->createOptionsResolver();
979979

980-
$datetimeNormalizer = function (OptionsResolver $optionsResolver, \DateTimeInterface $value) {
980+
$datetimeNormalizer = function (OptionsResolver $optionsResolver, \DateTimeInterface $value): string {
981981
return $value->format('Y-m-d');
982982
};
983983

src/Api/Repositories.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ public function releases($project_id)
201201
public function commits($project_id, array $parameters = [])
202202
{
203203
$resolver = $this->createOptionsResolver();
204-
$datetimeNormalizer = function (Options $options, \DateTimeInterface $value) {
204+
$datetimeNormalizer = function (Options $options, \DateTimeInterface $value): string {
205205
return $value->format('c');
206206
};
207-
$booleanNormalizer = function (Options $resolver, $value) {
207+
$booleanNormalizer = function (Options $resolver, $value): string {
208208
return $value ? 'true' : 'false';
209209
};
210210

@@ -470,7 +470,7 @@ public function mergeBase($project_id, array $refs)
470470
public function cherryPick($project_id, string $sha, array $params = [])
471471
{
472472
$resolver = $this->createOptionsResolver();
473-
$booleanNormalizer = function (Options $resolver, $value) {
473+
$booleanNormalizer = function (Options $resolver, $value): string {
474474
return $value ? 'true' : 'false';
475475
};
476476

src/Api/Users.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Users extends AbstractApi
3737
public function all(array $parameters = [])
3838
{
3939
$resolver = $this->createOptionsResolver();
40-
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value) {
40+
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value): string {
4141
return $value->format('c');
4242
};
4343

@@ -103,7 +103,7 @@ public function show(int $id)
103103
public function usersProjects(int $id, array $parameters = [])
104104
{
105105
$resolver = $this->createOptionsResolver();
106-
$booleanNormalizer = function (Options $resolver, $value) {
106+
$booleanNormalizer = function (Options $resolver, $value): string {
107107
return $value ? 'true' : 'false';
108108
};
109109
$resolver->setDefined('archived')
@@ -443,7 +443,7 @@ public function removeImpersonationToken(int $user_id, int $impersonation_token_
443443
public function events(int $user_id, array $parameters = [])
444444
{
445445
$resolver = $this->createOptionsResolver();
446-
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value) {
446+
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value): string {
447447
return $value->format('Y-m-d');
448448
};
449449

0 commit comments

Comments
 (0)