Code Duplication    Length = 12-13 lines in 7 locations

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

generated/Resource/ImageResource.php 3 locations

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