Skip to content

Commit 4117124

Browse files
Ridflavioheleno
authored andcommitted
Run lint-fix
Signed-off-by: Grant Millar <rid@cylo.io>
1 parent 438267a commit 4117124

762 files changed

Lines changed: 27506 additions & 29449 deletions

File tree

Some content is hidden

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

src/Client.php

Lines changed: 1835 additions & 1654 deletions
Large diffs are not rendered by default.

src/Endpoint/BuildPrune.php

Lines changed: 52 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,93 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Docker\API\Endpoint;
46

57
class BuildPrune extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint
68
{
9+
use \Docker\API\Runtime\Client\EndpointTrait;
10+
711
/**
8-
*
9-
*
10-
* @param array $queryParameters {
11-
* @var int $keep-storage Amount of disk space in bytes to keep for cache
12-
* @var bool $all Remove all types of build cache
13-
* @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to
14-
process on the list of build cache objects.
15-
16-
Available filters:
17-
18-
- `until=<duration>`: duration relative to daemon's time, during which build cache was not used, in Go's duration format (e.g., '24h')
19-
- `id=<id>`
20-
- `parent=<id>`
21-
- `type=<string>`
22-
- `description=<string>`
23-
- `inuse`
24-
- `shared`
25-
- `private`
26-
27-
* }
28-
*/
29-
public function __construct(array $queryParameters = array())
12+
* @param array $queryParameters {
13+
*
14+
* @var int $keep-storage Amount of disk space in bytes to keep for cache
15+
* @var bool $all Remove all types of build cache
16+
* @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to
17+
* process on the list of build cache objects.
18+
*
19+
* Available filters:
20+
*
21+
* - `until=<duration>`: duration relative to daemon's time, during which build cache was not used, in Go's duration format (e.g., '24h')
22+
* - `id=<id>`
23+
* - `parent=<id>`
24+
* - `type=<string>`
25+
* - `description=<string>`
26+
* - `inuse`
27+
* - `shared`
28+
* - `private`
29+
*
30+
* }
31+
*/
32+
public function __construct(array $queryParameters = [])
3033
{
3134
$this->queryParameters = $queryParameters;
3235
}
33-
use \Docker\API\Runtime\Client\EndpointTrait;
34-
public function getMethod() : string
36+
37+
public function getMethod(): string
3538
{
3639
return 'POST';
3740
}
38-
public function getUri() : string
41+
42+
public function getUri(): string
3943
{
4044
return '/build/prune';
4145
}
42-
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array
46+
47+
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
4348
{
44-
return array(array(), null);
49+
return [[], null];
4550
}
46-
public function getExtraHeaders() : array
51+
52+
public function getExtraHeaders(): array
4753
{
48-
return array('Accept' => array('application/json'));
54+
return ['Accept' => ['application/json']];
4955
}
50-
protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver
56+
57+
protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
5158
{
5259
$optionsResolver = parent::getQueryOptionsResolver();
53-
$optionsResolver->setDefined(array('keep-storage', 'all', 'filters'));
54-
$optionsResolver->setRequired(array());
55-
$optionsResolver->setDefaults(array());
56-
$optionsResolver->addAllowedTypes('keep-storage', array('int'));
57-
$optionsResolver->addAllowedTypes('all', array('bool'));
58-
$optionsResolver->addAllowedTypes('filters', array('string'));
60+
$optionsResolver->setDefined(['keep-storage', 'all', 'filters']);
61+
$optionsResolver->setRequired([]);
62+
$optionsResolver->setDefaults([]);
63+
$optionsResolver->addAllowedTypes('keep-storage', ['int']);
64+
$optionsResolver->addAllowedTypes('all', ['bool']);
65+
$optionsResolver->addAllowedTypes('filters', ['string']);
66+
5967
return $optionsResolver;
6068
}
69+
6170
/**
6271
* {@inheritdoc}
6372
*
6473
* @throws \Docker\API\Exception\BuildPruneInternalServerErrorException
6574
*
66-
* @return null|\Docker\API\Model\BuildPrunePostResponse200
75+
* @return \Docker\API\Model\BuildPrunePostResponse200|null
6776
*/
6877
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
6978
{
7079
$status = $response->getStatusCode();
7180
$body = (string) $response->getBody();
72-
if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) {
81+
if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
7382
return $serializer->deserialize($body, 'Docker\\API\\Model\\BuildPrunePostResponse200', 'json');
7483
}
75-
if (is_null($contentType) === false && (500 === $status && mb_strpos($contentType, 'application/json') !== false)) {
84+
if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) {
7685
throw new \Docker\API\Exception\BuildPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
7786
}
7887
}
79-
public function getAuthenticationScopes() : array
88+
89+
public function getAuthenticationScopes(): array
8090
{
81-
return array();
91+
return [];
8292
}
83-
}
93+
}

src/Endpoint/ConfigCreate.php

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,71 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Docker\API\Endpoint;
46

57
class ConfigCreate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint
68
{
7-
/**
8-
*
9-
*
10-
* @param null|\Docker\API\Model\ConfigsCreatePostBody $requestBody
11-
*/
9+
use \Docker\API\Runtime\Client\EndpointTrait;
10+
1211
public function __construct(?\Docker\API\Model\ConfigsCreatePostBody $requestBody = null)
1312
{
1413
$this->body = $requestBody;
1514
}
16-
use \Docker\API\Runtime\Client\EndpointTrait;
17-
public function getMethod() : string
15+
16+
public function getMethod(): string
1817
{
1918
return 'POST';
2019
}
21-
public function getUri() : string
20+
21+
public function getUri(): string
2222
{
2323
return '/configs/create';
2424
}
25-
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array
25+
26+
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
2627
{
2728
if ($this->body instanceof \Docker\API\Model\ConfigsCreatePostBody) {
28-
return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json'));
29+
return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')];
2930
}
30-
return array(array(), null);
31+
32+
return [[], null];
3133
}
32-
public function getExtraHeaders() : array
34+
35+
public function getExtraHeaders(): array
3336
{
34-
return array('Accept' => array('application/json'));
37+
return ['Accept' => ['application/json']];
3538
}
39+
3640
/**
3741
* {@inheritdoc}
3842
*
3943
* @throws \Docker\API\Exception\ConfigCreateConflictException
4044
* @throws \Docker\API\Exception\ConfigCreateInternalServerErrorException
4145
* @throws \Docker\API\Exception\ConfigCreateServiceUnavailableException
4246
*
43-
* @return null|\Docker\API\Model\IdResponse
47+
* @return \Docker\API\Model\IdResponse|null
4448
*/
4549
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
4650
{
4751
$status = $response->getStatusCode();
4852
$body = (string) $response->getBody();
49-
if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) {
53+
if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) {
5054
return $serializer->deserialize($body, 'Docker\\API\\Model\\IdResponse', 'json');
5155
}
52-
if (is_null($contentType) === false && (409 === $status && mb_strpos($contentType, 'application/json') !== false)) {
56+
if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) {
5357
throw new \Docker\API\Exception\ConfigCreateConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
5458
}
55-
if (is_null($contentType) === false && (500 === $status && mb_strpos($contentType, 'application/json') !== false)) {
59+
if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) {
5660
throw new \Docker\API\Exception\ConfigCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
5761
}
58-
if (is_null($contentType) === false && (503 === $status && mb_strpos($contentType, 'application/json') !== false)) {
62+
if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) {
5963
throw new \Docker\API\Exception\ConfigCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
6064
}
6165
}
62-
public function getAuthenticationScopes() : array
66+
67+
public function getAuthenticationScopes(): array
6368
{
64-
return array();
69+
return [];
6570
}
66-
}
71+
}

src/Endpoint/ConfigDelete.php

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Docker\API\Endpoint;
46

57
class ConfigDelete extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint
68
{
9+
use \Docker\API\Runtime\Client\EndpointTrait;
710
protected $id;
11+
812
/**
9-
*
10-
*
1113
* @param string $id ID of the config
1214
*/
1315
public function __construct(string $id)
1416
{
1517
$this->id = $id;
1618
}
17-
use \Docker\API\Runtime\Client\EndpointTrait;
18-
public function getMethod() : string
19+
20+
public function getMethod(): string
1921
{
2022
return 'DELETE';
2123
}
22-
public function getUri() : string
24+
25+
public function getUri(): string
2326
{
24-
return str_replace(array('{id}'), array($this->id), '/configs/{id}');
27+
return str_replace(['{id}'], [$this->id], '/configs/{id}');
2528
}
26-
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array
29+
30+
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
2731
{
28-
return array(array(), null);
32+
return [[], null];
2933
}
30-
public function getExtraHeaders() : array
34+
35+
public function getExtraHeaders(): array
3136
{
32-
return array('Accept' => array('application/json'));
37+
return ['Accept' => ['application/json']];
3338
}
39+
3440
/**
3541
* {@inheritdoc}
3642
*
@@ -46,18 +52,19 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re
4652
$body = (string) $response->getBody();
4753
if (204 === $status) {
4854
}
49-
if (is_null($contentType) === false && (404 === $status && mb_strpos($contentType, 'application/json') !== false)) {
55+
if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
5056
throw new \Docker\API\Exception\ConfigDeleteNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
5157
}
52-
if (is_null($contentType) === false && (500 === $status && mb_strpos($contentType, 'application/json') !== false)) {
58+
if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) {
5359
throw new \Docker\API\Exception\ConfigDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
5460
}
55-
if (is_null($contentType) === false && (503 === $status && mb_strpos($contentType, 'application/json') !== false)) {
61+
if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) {
5662
throw new \Docker\API\Exception\ConfigDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
5763
}
5864
}
59-
public function getAuthenticationScopes() : array
65+
66+
public function getAuthenticationScopes(): array
6067
{
61-
return array();
68+
return [];
6269
}
63-
}
70+
}

0 commit comments

Comments
 (0)