Completed
Pull Request — master (#11)
by Volodymyr
08:11 queued 03:25
created

ReferenceEntityMediaFileApiAdapter::download()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ReferenceEntity;
9
10
use Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface;
11
use Psr\Http\Message\ResponseInterface;
12
13
class ReferenceEntityMediaFileApiAdapter implements ReferenceEntityMediaFileApiAdapterInterface
14
{
15
    /**
16
     * @var \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface
17
     */
18
    protected $akeneoPimClient;
19
20
    /**
21
     * @param \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface $akeneoPimClient
22
     */
23
    public function __construct(AkeneoPimEnterpriseClientInterface $akeneoPimClient)
24
    {
25
        $this->akeneoPimClient = $akeneoPimClient;
26
    }
27
28
    /**
29
     * @param string $code
30
     *
31
     * @return \Psr\Http\Message\ResponseInterface
32
     */
33
    public function download(string $code): ResponseInterface
34
    {
35
        return $this->akeneoPimClient
36
            ->getReferenceEntityMediaFileApi()
37
            ->download($code);
38
    }
39
}
40