Skip to content

Commit 4033f5a

Browse files
Move union types inline
1 parent 7e6f08f commit 4033f5a

29 files changed

+344
-344
lines changed

src/Api/AbstractApi.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ protected function delete(string $uri, array $params = [], array $headers = [])
208208
/**
209209
* @param int|string $uri
210210
*/
211-
protected static function encodePath($uri): string
211+
protected static function encodePath(int|string $uri): string
212212
{
213213
return \rawurlencode((string) $uri);
214214
}
215215

216216
/**
217217
* @param int|string $id
218218
*/
219-
protected function getProjectPath($id, string $uri): string
219+
protected function getProjectPath(int|string $id, string $uri): string
220220
{
221221
return 'projects/'.self::encodePath($id).'/'.$uri;
222222
}

src/Api/Deployments.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Deployments extends AbstractApi
3131
*
3232
* @return mixed
3333
*/
34-
public function all($project_id, array $parameters = [])
34+
public function all(int|string $project_id, array $parameters = [])
3535
{
3636
$resolver = $this->createOptionsResolver();
3737
$resolver->setDefined('order_by')
@@ -54,7 +54,7 @@ public function all($project_id, array $parameters = [])
5454
*
5555
* @return mixed
5656
*/
57-
public function show($project_id, int $deployment_id)
57+
public function show(int|string $project_id, int $deployment_id)
5858
{
5959
return $this->get($this->getProjectPath($project_id, 'deployments/'.$deployment_id));
6060
}

src/Api/Environments.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Environments extends AbstractApi
2323
*
2424
* @return mixed
2525
*/
26-
public function all($project_id, array $parameters = [])
26+
public function all(int|string $project_id, array $parameters = [])
2727
{
2828
$resolver = $this->createOptionsResolver();
2929
$resolver->setDefined('name')
@@ -48,7 +48,7 @@ public function all($project_id, array $parameters = [])
4848
*
4949
* @return mixed
5050
*/
51-
public function create($project_id, array $parameters = [])
51+
public function create(int|string $project_id, array $parameters = [])
5252
{
5353
$resolver = new OptionsResolver();
5454
$resolver->setDefined('name')
@@ -67,7 +67,7 @@ public function create($project_id, array $parameters = [])
6767
*
6868
* @return mixed
6969
*/
70-
public function remove($project_id, int $environment_id)
70+
public function remove(int|string $project_id, int $environment_id)
7171
{
7272
return $this->delete($this->getProjectPath($project_id, 'environments/'.$environment_id));
7373
}
@@ -77,7 +77,7 @@ public function remove($project_id, int $environment_id)
7777
*
7878
* @return mixed
7979
*/
80-
public function stop($project_id, int $environment_id)
80+
public function stop(int|string $project_id, int $environment_id)
8181
{
8282
return $this->post($this->getProjectPath($project_id, 'environments/'.self::encodePath($environment_id).'/stop'));
8383
}
@@ -87,7 +87,7 @@ public function stop($project_id, int $environment_id)
8787
*
8888
* @return mixed
8989
*/
90-
public function show($project_id, int $environment_id)
90+
public function show(int|string $project_id, int $environment_id)
9191
{
9292
return $this->get($this->getProjectPath($project_id, 'environments/'.self::encodePath($environment_id)));
9393
}

src/Api/Groups.php

+31-31
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function all(array $parameters = [])
7474
*
7575
* @return mixed
7676
*/
77-
public function show($id)
77+
public function show(int|string $id)
7878
{
7979
return $this->get('groups/'.self::encodePath($id));
8080
}
@@ -105,7 +105,7 @@ public function create(string $name, string $path, ?string $description = null,
105105
*
106106
* @return mixed
107107
*/
108-
public function update($id, array $params)
108+
public function update(int|string $id, array $params)
109109
{
110110
return $this->put('groups/'.self::encodePath($id), $params);
111111
}
@@ -115,7 +115,7 @@ public function update($id, array $params)
115115
*
116116
* @return mixed
117117
*/
118-
public function remove($group_id)
118+
public function remove(int|string $group_id)
119119
{
120120
return $this->delete('groups/'.self::encodePath($group_id));
121121
}
@@ -126,7 +126,7 @@ public function remove($group_id)
126126
*
127127
* @return mixed
128128
*/
129-
public function transfer($group_id, $project_id)
129+
public function transfer(int|string $group_id, int|string $project_id)
130130
{
131131
return $this->post('groups/'.self::encodePath($group_id).'/projects/'.self::encodePath($project_id));
132132
}
@@ -136,7 +136,7 @@ public function transfer($group_id, $project_id)
136136
*
137137
* @return mixed
138138
*/
139-
public function allMembers($group_id, array $parameters = [])
139+
public function allMembers(int|string $group_id, array $parameters = [])
140140
{
141141
$resolver = $this->createOptionsResolver();
142142
$resolver->setDefined('query');
@@ -159,7 +159,7 @@ public function allMembers($group_id, array $parameters = [])
159159
*
160160
* @return mixed
161161
*/
162-
public function members($group_id, array $parameters = [])
162+
public function members(int|string $group_id, array $parameters = [])
163163
{
164164
$resolver = $this->createOptionsResolver();
165165
$resolver->setDefined('query');
@@ -178,7 +178,7 @@ public function members($group_id, array $parameters = [])
178178
*
179179
* @return mixed
180180
*/
181-
public function member($group_id, int $user_id)
181+
public function member(int|string $group_id, int $user_id)
182182
{
183183
return $this->get('groups/'.self::encodePath($group_id).'/members/'.self::encodePath($user_id));
184184
}
@@ -188,7 +188,7 @@ public function member($group_id, int $user_id)
188188
*
189189
* @return mixed
190190
*/
191-
public function allMember($group_id, int $user_id)
191+
public function allMember(int|string $group_id, int $user_id)
192192
{
193193
return $this->get('groups/'.self::encodePath($group_id).'/members/all/'.self::encodePath($user_id));
194194
}
@@ -198,7 +198,7 @@ public function allMember($group_id, int $user_id)
198198
*
199199
* @return mixed
200200
*/
201-
public function addMember($group_id, int $user_id, int $access_level, array $parameters = [])
201+
public function addMember(int|string $group_id, int $user_id, int $access_level, array $parameters = [])
202202
{
203203
$dateNormalizer = function (OptionsResolver $optionsResolver, \DateTimeInterface $date): string {
204204
return $date->format('Y-m-d');
@@ -223,7 +223,7 @@ public function addMember($group_id, int $user_id, int $access_level, array $par
223223
*
224224
* @return mixed
225225
*/
226-
public function saveMember($group_id, int $user_id, int $access_level)
226+
public function saveMember(int|string $group_id, int $user_id, int $access_level)
227227
{
228228
return $this->put('groups/'.self::encodePath($group_id).'/members/'.self::encodePath($user_id), [
229229
'access_level' => $access_level,
@@ -240,7 +240,7 @@ public function saveMember($group_id, int $user_id, int $access_level)
240240
*
241241
* @return mixed
242242
*/
243-
public function addShare($group_id, array $parameters = [])
243+
public function addShare(int|string $group_id, array $parameters = [])
244244
{
245245
$resolver = $this->createOptionsResolver();
246246

@@ -268,7 +268,7 @@ public function addShare($group_id, array $parameters = [])
268268
*
269269
* @return mixed
270270
*/
271-
public function removeMember($group_id, int $user_id)
271+
public function removeMember(int|string $group_id, int $user_id)
272272
{
273273
return $this->delete('groups/'.self::encodePath($group_id).'/members/'.self::encodePath($user_id));
274274
}
@@ -295,7 +295,7 @@ public function removeMember($group_id, int $user_id)
295295
*
296296
* @return mixed
297297
*/
298-
public function projects($id, array $parameters = [])
298+
public function projects(int|string $id, array $parameters = [])
299299
{
300300
$resolver = $this->createOptionsResolver();
301301
$booleanNormalizer = function (Options $resolver, $value): string {
@@ -367,7 +367,7 @@ public function projects($id, array $parameters = [])
367367
*
368368
* @return mixed
369369
*/
370-
public function subgroups($group_id, array $parameters = [])
370+
public function subgroups(int|string $group_id, array $parameters = [])
371371
{
372372
$resolver = $this->getSubgroupSearchResolver();
373373

@@ -408,7 +408,7 @@ public function subgroups($group_id, array $parameters = [])
408408
*
409409
* @return mixed
410410
*/
411-
public function issues($group_id, array $parameters = [])
411+
public function issues(int|string $group_id, array $parameters = [])
412412
{
413413
$resolver = $this->createOptionsResolver();
414414
$booleanNormalizer = function (Options $resolver, $value): string {
@@ -500,7 +500,7 @@ public function issues($group_id, array $parameters = [])
500500
*
501501
* @return mixed
502502
*/
503-
public function labels($group_id, array $parameters = [])
503+
public function labels(int|string $group_id, array $parameters = [])
504504
{
505505
$resolver = $this->createOptionsResolver();
506506

@@ -527,7 +527,7 @@ public function labels($group_id, array $parameters = [])
527527
*
528528
* @return mixed
529529
*/
530-
public function addLabel($group_id, array $params)
530+
public function addLabel(int|string $group_id, array $params)
531531
{
532532
return $this->post('groups/'.self::encodePath($group_id).'/labels', $params);
533533
}
@@ -537,7 +537,7 @@ public function addLabel($group_id, array $params)
537537
*
538538
* @return mixed
539539
*/
540-
public function updateLabel($group_id, int $label_id, array $params)
540+
public function updateLabel(int|string $group_id, int $label_id, array $params)
541541
{
542542
return $this->put('groups/'.self::encodePath($group_id).'/labels/'.self::encodePath($label_id), $params);
543543
}
@@ -547,7 +547,7 @@ public function updateLabel($group_id, int $label_id, array $params)
547547
*
548548
* @return mixed
549549
*/
550-
public function removeLabel($group_id, int $label_id)
550+
public function removeLabel(int|string $group_id, int $label_id)
551551
{
552552
return $this->delete('groups/'.self::encodePath($group_id).'/labels/'.self::encodePath($label_id));
553553
}
@@ -557,7 +557,7 @@ public function removeLabel($group_id, int $label_id)
557557
*
558558
* @return mixed
559559
*/
560-
public function variables($group_id, array $parameters = [])
560+
public function variables(int|string $group_id, array $parameters = [])
561561
{
562562
$resolver = $this->createOptionsResolver();
563563

@@ -569,7 +569,7 @@ public function variables($group_id, array $parameters = [])
569569
*
570570
* @return mixed
571571
*/
572-
public function variable($group_id, string $key)
572+
public function variable(int|string $group_id, string $key)
573573
{
574574
return $this->get('groups/'.self::encodePath($group_id).'/variables/'.self::encodePath($key));
575575
}
@@ -584,7 +584,7 @@ public function variable($group_id, string $key)
584584
*
585585
* @return mixed
586586
*/
587-
public function addVariable($group_id, string $key, string $value, ?bool $protected = null, array $parameters = [])
587+
public function addVariable(int|string $group_id, string $key, string $value, ?bool $protected = null, array $parameters = [])
588588
{
589589
$payload = [
590590
'key' => $key,
@@ -611,7 +611,7 @@ public function addVariable($group_id, string $key, string $value, ?bool $protec
611611
*
612612
* @return mixed
613613
*/
614-
public function updateVariable($group_id, string $key, string $value, ?bool $protected = null)
614+
public function updateVariable(int|string $group_id, string $key, string $value, ?bool $protected = null)
615615
{
616616
$payload = [
617617
'value' => $value,
@@ -629,7 +629,7 @@ public function updateVariable($group_id, string $key, string $value, ?bool $pro
629629
*
630630
* @return mixed
631631
*/
632-
public function removeVariable($group_id, string $key)
632+
public function removeVariable(int|string $group_id, string $key)
633633
{
634634
return $this->delete('groups/'.self::encodePath($group_id).'/variables/'.self::encodePath($key));
635635
}
@@ -654,7 +654,7 @@ public function removeVariable($group_id, string $key)
654654
*
655655
* @return mixed
656656
*/
657-
public function mergeRequests($group_id, array $parameters = [])
657+
public function mergeRequests(int|string $group_id, array $parameters = [])
658658
{
659659
$resolver = $this->createOptionsResolver();
660660
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value): string {
@@ -748,7 +748,7 @@ public function mergeRequests($group_id, array $parameters = [])
748748
*
749749
* @return mixed
750750
*/
751-
public function iterations($group_id, array $parameters = [])
751+
public function iterations(int|string $group_id, array $parameters = [])
752752
{
753753
$resolver = $this->createOptionsResolver();
754754
$booleanNormalizer = function (Options $resolver, $value): string {
@@ -787,7 +787,7 @@ public function iterations($group_id, array $parameters = [])
787787
*
788788
* @return mixed
789789
*/
790-
public function packages($group_id, array $parameters = [])
790+
public function packages(int|string $group_id, array $parameters = [])
791791
{
792792
$resolver = $this->createOptionsResolver();
793793
$booleanNormalizer = function (Options $resolver, $value): string {
@@ -884,7 +884,7 @@ private function getSubgroupSearchResolver()
884884
*
885885
* @return mixed
886886
*/
887-
public function deployTokens($group_id, ?bool $active = null)
887+
public function deployTokens(int|string $group_id, ?bool $active = null)
888888
{
889889
return $this->get('groups/'.self::encodePath($group_id).'/deploy_tokens', (null !== $active) ? ['active' => $active] : []);
890890
}
@@ -901,7 +901,7 @@ public function deployTokens($group_id, ?bool $active = null)
901901
*
902902
* @return mixed
903903
*/
904-
public function createDeployToken($group_id, array $parameters = [])
904+
public function createDeployToken(int|string $group_id, array $parameters = [])
905905
{
906906
$resolver = $this->createOptionsResolver();
907907
$datetimeNormalizer = function (Options $resolver, \DateTimeInterface $value): string {
@@ -943,7 +943,7 @@ public function createDeployToken($group_id, array $parameters = [])
943943
*
944944
* @return mixed
945945
*/
946-
public function deleteDeployToken($group_id, int $token_id)
946+
public function deleteDeployToken(int|string $group_id, int $token_id)
947947
{
948948
return $this->delete('groups/'.self::encodePath($group_id).'/deploy_tokens/'.self::encodePath($token_id));
949949
}
@@ -965,7 +965,7 @@ public function deleteDeployToken($group_id, int $token_id)
965965
*
966966
* @return mixed
967967
*/
968-
public function search($id, array $parameters = [])
968+
public function search(int|string $id, array $parameters = [])
969969
{
970970
$resolver = $this->createOptionsResolver();
971971
$booleanNormalizer = function (Options $resolver, $value): string {

0 commit comments

Comments
 (0)