Code Duplication    Length = 12-13 lines in 7 locations

generated/Resource/ImageResource.php 3 locations

@@ 331-342 (lines=12) @@
328
     *
329
     * @return \Psr\Http\Message\ResponseInterface
330
     */
331
    public function save($parameters = [], $fetch = self::FETCH_OBJECT)
332
    {
333
        $queryParam = new QueryParam();
334
        $url        = '/v1.21/images/{name}/get';
335
        $url        = $url . ('?' . $queryParam->buildQueryString($parameters));
336
        $headers    = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
337
        $body       = $queryParam->buildFormDataString($parameters);
338
        $request    = $this->messageFactory->createRequest('GET', $url, $headers, $body);
339
        $response   = $this->httpClient->sendRequest($request);
340
341
        return $response;
342
    }
343
344
    /**
345
     * Get a tarball containing all images and metadata for one or more repositories.
@@ 354-366 (lines=13) @@
351
     *
352
     * @return \Psr\Http\Message\ResponseInterface
353
     */
354
    public function saveAll($parameters = [], $fetch = self::FETCH_OBJECT)
355
    {
356
        $queryParam = new QueryParam();
357
        $queryParam->setDefault('names', null);
358
        $url      = '/v1.21/images/get';
359
        $url      = $url . ('?' . $queryParam->buildQueryString($parameters));
360
        $headers  = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
361
        $body     = $queryParam->buildFormDataString($parameters);
362
        $request  = $this->messageFactory->createRequest('GET', $url, $headers, $body);
363
        $response = $this->httpClient->sendRequest($request);
364
365
        return $response;
366
    }
367
368
    /**
369
     * Load a set of images and tags into a Docker repository. See the image tarball format for more details.
@@ 377-388 (lines=12) @@
374
     *
375
     * @return \Psr\Http\Message\ResponseInterface
376
     */
377
    public function load(string $imagesTarball, $parameters = [], $fetch = self::FETCH_OBJECT)
378
    {
379
        $queryParam = new QueryParam();
380
        $url        = '/v1.21/images/load';
381
        $url        = $url . ('?' . $queryParam->buildQueryString($parameters));
382
        $headers    = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
383
        $body       = $imagesTarball;
384
        $request    = $this->messageFactory->createRequest('POST', $url, $headers, $body);
385
        $response   = $this->httpClient->sendRequest($request);
386
387
        return $response;
388
    }
389
}
390

generated/Resource/MiscResource.php 2 locations

@@ 19-30 (lines=12) @@
16
     *
17
     * @return \Psr\Http\Message\ResponseInterface
18
     */
19
    public function checkAuthentication(\Docker\API\Model\AuthConfig $authConfig, $parameters = [], $fetch = self::FETCH_OBJECT)
20
    {
21
        $queryParam = new QueryParam();
22
        $url        = '/v1.21/auth';
23
        $url        = $url . ('?' . $queryParam->buildQueryString($parameters));
24
        $headers    = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
25
        $body       = $this->serializer->serialize($authConfig, 'json');
26
        $request    = $this->messageFactory->createRequest('POST', $url, $headers, $body);
27
        $response   = $this->httpClient->sendRequest($request);
28
29
        return $response;
30
    }
31
32
    /**
33
     * Display system-wide information.
@@ 92-103 (lines=12) @@
89
     *
90
     * @return \Psr\Http\Message\ResponseInterface
91
     */
92
    public function ping($parameters = [], $fetch = self::FETCH_OBJECT)
93
    {
94
        $queryParam = new QueryParam();
95
        $url        = '/v1.21/_ping';
96
        $url        = $url . ('?' . $queryParam->buildQueryString($parameters));
97
        $headers    = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
98
        $body       = $queryParam->buildFormDataString($parameters);
99
        $request    = $this->messageFactory->createRequest('GET', $url, $headers, $body);
100
        $response   = $this->httpClient->sendRequest($request);
101
102
        return $response;
103
    }
104
105
    /**
106
     * Get container events from docker, either in real time via streaming, or via polling (using since).

generated/Resource/NetworkResource.php 2 locations

@@ 126-137 (lines=12) @@
123
     *
124
     * @return \Psr\Http\Message\ResponseInterface
125
     */
126
    public function connect(\Docker\API\Model\ContainerConnect $container, $parameters = [], $fetch = self::FETCH_OBJECT)
127
    {
128
        $queryParam = new QueryParam();
129
        $url        = '/v1.21/networks/{id}/connect';
130
        $url        = $url . ('?' . $queryParam->buildQueryString($parameters));
131
        $headers    = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
132
        $body       = $this->serializer->serialize($container, 'json');
133
        $request    = $this->messageFactory->createRequest('POST', $url, $headers, $body);
134
        $response   = $this->httpClient->sendRequest($request);
135
136
        return $response;
137
    }
138
139
    /**
140
     * Disconnect a container to a network.
@@ 148-159 (lines=12) @@
145
     *
146
     * @return \Psr\Http\Message\ResponseInterface
147
     */
148
    public function disconnect(\Docker\API\Model\ContainerConnect $container, $parameters = [], $fetch = self::FETCH_OBJECT)
149
    {
150
        $queryParam = new QueryParam();
151
        $url        = '/v1.21/networks/{id}/disconnect';
152
        $url        = $url . ('?' . $queryParam->buildQueryString($parameters));
153
        $headers    = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
154
        $body       = $this->serializer->serialize($container, 'json');
155
        $request    = $this->messageFactory->createRequest('POST', $url, $headers, $body);
156
        $response   = $this->httpClient->sendRequest($request);
157
158
        return $response;
159
    }
160
}
161