11<?php
22
3+ declare (strict_types=1 );
4+
35namespace Docker \API \Endpoint ;
46
57class 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+ }
0 commit comments