Passed
Pull Request — master (#11)
by Volodymyr
09:33 queued 04:51
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
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface;
13
14
class ReferenceEntityMediaFileApiAdapter implements ReferenceEntityMediaFileApiAdapterInterface
15
{
16
    /**
17
     * @var \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface
18
     */
19
    protected $akeneoPimClient;
20
21
    /**
22
     * @var \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface
23
     */
24
    protected $wrapperFactory;
25
26
    /**
27
     * @param \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface $akeneoPimClient
28
     * @param \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface $wrapperFactory
29
     */
30
    public function __construct(AkeneoPimEnterpriseClientInterface $akeneoPimClient, WrapperFactoryInterface $wrapperFactory)
31
    {
32
        $this->akeneoPimClient = $akeneoPimClient;
33
        $this->wrapperFactory = $wrapperFactory;
34
    }
35
36
    /**
37
     * @param string $code
38
     *
39
     * @return \Psr\Http\Message\ResponseInterface
40
     */
41
    public function download(string $code): ResponseInterface
42
    {
43
        return $this->akeneoPimClient
44
            ->getReferenceEntityMediaFileApi()
45
            ->download($code);
46
    }
47
}
48