Passed
Push — feature/eco-2812-akeneo-v-3-1-... ( 72bdf2...76942a )
by Volodymyr
04:11
created

__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 SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface;
7
8
class ReferenceEntityAttributeOptionApiAdapter implements ReferenceEntityAttributeOptionApiAdapterInterface
9
{
10
    /**
11
     * @var \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface
12
     */
13
    protected $akeneoPimClient;
14
15
    /**
16
     * @var \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface
17
     */
18
    private $wrapperFactory;
19
20
    /**
21
     * @param \Akeneo\Pim\ApiClient\AkeneoPimClientInterface $akeneoPimClient
22
     * @param \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface $wrapperFactory
23
     */
24
    public function __construct(AkeneoPimEnterpriseClientInterface $akeneoPimClient, WrapperFactoryInterface $wrapperFactory)
25
    {
26
        $this->akeneoPimClient = $akeneoPimClient;
27
        $this->wrapperFactory = $wrapperFactory;
28
    }
29
30
    /**
31
     * @param string $referenceEntityCode Code of the reference entity
32
     * @param string $attributeCode Code of the attribute
33
     * @param string $attributeOptionCode Code of the attribute option
34
     *
35
     * @return array
36
     */
37
    public function get(string $referenceEntityCode, string $attributeCode, string $attributeOptionCode): array
38
    {
39
        return $this->akeneoPimClient
40
            ->getReferenceEntityAttributeOptionApi()
41
            ->get($referenceEntityCode, $attributeCode, $attributeOptionCode);
42
    }
43
44
    /**
45
     * @param string $referenceEntityCode Code of the reference entity
46
     * @param string $attributeCode Code of the attribute
47
     *
48
     * @return array
49
     */
50
    public function all(string $referenceEntityCode, string $attributeCode): array
51
    {
52
        return $this->akeneoPimClient
53
            ->getReferenceEntityAttributeOptionApi()
54
            ->all($referenceEntityCode, $attributeCode);
55
    }
56
}
57