Skip to content

Commit 4baaffb

Browse files
Merge branch '10.0' of https://github.com/GitLabPHP/Client into 10.0
2 parents 079f12b + 85dd0cd commit 4baaffb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+436
-429
lines changed

.styleci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
preset: symfony
22

3+
risky: true
4+
35
enabled:
46
- align_phpdoc
57
- alpha_ordered_imports
68
- array_indentation
79
- const_visibility_required
10+
- native_constant_invocation
11+
- native_function_invocation
812
- phpdoc_order
13+
- void_return
914

1015
disabled:
16+
- native_constant_invocation_symfony
17+
- native_function_invocation_symfony
1118
- no_superfluous_phpdoc_tags_symfony
1219
- phpdoc_to_comment
1320
- phpdoc_var_without_name

src/Api/AbstractApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ private static function addJsonContentType(array $headers)
357357
private static function tryFopen(string $filename, string $mode)
358358
{
359359
$ex = null;
360-
\set_error_handler(function () use ($filename, $mode, &$ex) {
360+
\set_error_handler(function () use ($filename, $mode, &$ex): void {
361361
$ex = new RuntimeException(\sprintf(
362362
'Unable to open %s using mode %s: %s',
363363
$filename,
@@ -390,7 +390,7 @@ private static function guessFileContentType(string $file)
390390
return ResponseMediator::STREAM_CONTENT_TYPE;
391391
}
392392

393-
$finfo = new \finfo(FILEINFO_MIME_TYPE);
393+
$finfo = new \finfo(\FILEINFO_MIME_TYPE);
394394
$type = $finfo->file($file);
395395

396396
return false !== $type ? $type : ResponseMediator::STREAM_CONTENT_TYPE;

src/HttpClient/Builder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function getUriFactory()
159159
*
160160
* @return void
161161
*/
162-
public function addPlugin(Plugin $plugin)
162+
public function addPlugin(Plugin $plugin): void
163163
{
164164
$this->plugins[] = $plugin;
165165
$this->pluginClient = null;
@@ -172,7 +172,7 @@ public function addPlugin(Plugin $plugin)
172172
*
173173
* @return void
174174
*/
175-
public function removePlugin(string $fqcn)
175+
public function removePlugin(string $fqcn): void
176176
{
177177
foreach ($this->plugins as $idx => $plugin) {
178178
if ($plugin instanceof $fqcn) {
@@ -190,7 +190,7 @@ public function removePlugin(string $fqcn)
190190
*
191191
* @return void
192192
*/
193-
public function addCache(CacheItemPoolInterface $cachePool, array $config = [])
193+
public function addCache(CacheItemPoolInterface $cachePool, array $config = []): void
194194
{
195195
if (!isset($config['cache_key_generator'])) {
196196
$config['cache_key_generator'] = new HeaderCacheKeyGenerator(['Authorization', 'Cookie', 'Accept', 'Content-type']);
@@ -205,7 +205,7 @@ public function addCache(CacheItemPoolInterface $cachePool, array $config = [])
205205
*
206206
* @return void
207207
*/
208-
public function removeCache()
208+
public function removeCache(): void
209209
{
210210
$this->cachePlugin = null;
211211
$this->pluginClient = null;

src/HttpClient/Plugin/History.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function getLastResponse()
3939
*
4040
* @return void
4141
*/
42-
public function addSuccess(RequestInterface $request, ResponseInterface $response)
42+
public function addSuccess(RequestInterface $request, ResponseInterface $response): void
4343
{
4444
$this->lastResponse = $response;
4545
}
@@ -52,7 +52,7 @@ public function addSuccess(RequestInterface $request, ResponseInterface $respons
5252
*
5353
* @return void
5454
*/
55-
public function addFailure(RequestInterface $request, ClientExceptionInterface $exception)
55+
public function addFailure(RequestInterface $request, ClientExceptionInterface $exception): void
5656
{
5757
}
5858
}

src/HttpClient/Util/QueryStringBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ public static function build(array $query)
2222
return '';
2323
}
2424

25-
return \sprintf('?%s', \http_build_query($query, '', '&', PHP_QUERY_RFC3986));
25+
return \sprintf('?%s', \http_build_query($query, '', '&', \PHP_QUERY_RFC3986));
2626
}
2727
}

src/Model/AbstractModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function getData()
9191
*
9292
* @return void
9393
*/
94-
public function __set(string $property, $value)
94+
public function __set(string $property, $value): void
9595
{
9696
throw new RuntimeException('Model properties are immutable');
9797
}
@@ -106,7 +106,7 @@ public function __set(string $property, $value)
106106
public function __get(string $property)
107107
{
108108
if (!\in_array($property, static::$properties, true)) {
109-
throw new RuntimeException(\sprintf('Property "%s" does not exist for %s object', $property, \get_called_class()));
109+
throw new RuntimeException(\sprintf('Property "%s" does not exist for %s object', $property, static::class));
110110
}
111111

112112
if (isset($this->data[$property])) {

src/ResultPager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function fetchLast()
204204
*
205205
* @return void
206206
*/
207-
private function postFetch()
207+
private function postFetch(): void
208208
{
209209
$response = $this->client->getLastResponse();
210210

tests/Api/DeployKeysTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class DeployKeysTest extends TestCase
1111
/**
1212
* @test
1313
*/
14-
public function shouldGetAllDeployKeys()
14+
public function shouldGetAllDeployKeys(): void
1515
{
1616
$expectedArray = $this->getMultipleDeployKeysData();
1717

tests/Api/DeploymentsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class DeploymentsTest extends TestCase
1111
/**
1212
* @test
1313
*/
14-
public function shouldGetAllDeployments()
14+
public function shouldGetAllDeployments(): void
1515
{
1616
$expectedArray = [
1717
[
@@ -155,7 +155,7 @@ public function shouldGetAllDeployments()
155155
/**
156156
* @test
157157
*/
158-
public function shouldShowDeployment()
158+
public function shouldShowDeployment(): void
159159
{
160160
$expectedArray = [
161161
[

tests/Api/EnvironmentsTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class EnvironmentsTest extends TestCase
1111
/**
1212
* @test
1313
*/
14-
public function shouldGetAllEnvironments()
14+
public function shouldGetAllEnvironments(): void
1515
{
1616
$expectedArray = [
1717
[
@@ -37,7 +37,7 @@ public function shouldGetAllEnvironments()
3737
}
3838

3939
/** @test */
40-
public function shouldFilterEnvironmentByName()
40+
public function shouldFilterEnvironmentByName(): void
4141
{
4242
$expected = [
4343
[
@@ -58,7 +58,7 @@ public function shouldFilterEnvironmentByName()
5858
/**
5959
* @test
6060
*/
61-
public function shouldGetSingleEnvironment()
61+
public function shouldGetSingleEnvironment(): void
6262
{
6363
$expected = [
6464
'id' => 1,
@@ -137,7 +137,7 @@ public function shouldGetSingleEnvironment()
137137
/**
138138
* @test
139139
*/
140-
public function shouldCreateEnvironment()
140+
public function shouldCreateEnvironment(): void
141141
{
142142
$expectedArray = [
143143
[
@@ -165,7 +165,7 @@ public function shouldCreateEnvironment()
165165
/**
166166
* @test
167167
*/
168-
public function shouldRemoveEnvironment()
168+
public function shouldRemoveEnvironment(): void
169169
{
170170
$expectedBool = true;
171171

@@ -180,7 +180,7 @@ public function shouldRemoveEnvironment()
180180
/**
181181
* @test
182182
*/
183-
public function shouldStopEnvironment()
183+
public function shouldStopEnvironment(): void
184184
{
185185
$expectedBool = true;
186186

0 commit comments

Comments
 (0)