Passed
Push — feature/eco-2812-akeneo-v-3-1-... ( ef8b8e...b82c6e )
by Volodymyr
03:02
created

ReferenceEntityMediaFileApiAdapter::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ReferenceEntity;
4
5
use Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface;
0 ignored issues
show
Bug introduced by
The type Akeneo\PimEnterprise\Api...terpriseClientInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Psr\Http\Message\ResponseInterface;
7
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface;
8
9
class ReferenceEntityMediaFileApiAdapter implements ReferenceEntityMediaFileApiAdapterInterface
10
{
11
    /**
12
     * @var \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface
13
     */
14
    protected $akeneoPimClient;
15
16
    /**
17
     * @var \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface
18
     */
19
    protected $wrapperFactory;
20
21
    /**
22
     * @param AkeneoPimEnterpriseClientInterface $akeneoPimClient
23
     * @param \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface $wrapperFactory
24
     */
25
    public function __construct(AkeneoPimEnterpriseClientInterface $akeneoPimClient, WrapperFactoryInterface $wrapperFactory)
26
    {
27
        $this->akeneoPimClient = $akeneoPimClient;
28
        $this->wrapperFactory = $wrapperFactory;
29
    }
30
31
    /**
32
     * @param string $code
33
     *
34
     * @return ResponseInterface
35
     */
36
    public function download(string $code): ResponseInterface
37
    {
38
        return $this->akeneoPimClient
39
            ->getReferenceEntityMediaFileApi()
40
            ->download($code);
41
    }
42
}
43