Passed
Pull Request — master (#11)
by Oleksandr
04:55
created

ReferenceEntityAttributeApiAdapter::get()   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
nc 1
nop 2
dl 0
loc 5
rs 10
c 1
b 0
f 0
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\Pim\ApiClient\Pagination\ResourceCursorInterface;
11
use Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface;
12
13
class ReferenceEntityAttributeApiAdapter implements ReferenceEntityAttributeApiAdapterInterface
14
{
15
    /**
16
     * @var \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface
17
     */
18
    protected $akeneoPimClient;
19
20
    /**
21
     * @param \Akeneo\Pim\ApiClient\AkeneoPimClientInterface $akeneoPimClient
22
     */
23
    public function __construct(AkeneoPimEnterpriseClientInterface $akeneoPimClient)
24
    {
25
        $this->akeneoPimClient = $akeneoPimClient;
26
    }
27
28
    /**
29
     * @param string $referenceEntityCode
30
     * @param string $attributeCode
31
     *
32
     * @return array
33
     */
34
    public function get(string $referenceEntityCode, string $attributeCode): array
35
    {
36
        return $this->akeneoPimClient
37
            ->getReferenceEntityAttributeApi()
38
            ->get($referenceEntityCode, $attributeCode);
39
    }
40
41
    /**
42
     * @param string $referenceEntityCode
43
     * @param array $queryParameters
44
     *
45
     * @return \Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface
46
     */
47
    public function all(string $referenceEntityCode, array $queryParameters = []): ResourceCursorInterface
48
    {
49
        return $this->akeneoPimClient
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->akeneoPimC...Code, $queryParameters) returns the type array which is incompatible with the type-hinted return Akeneo\Pim\ApiClient\Pag...ResourceCursorInterface.
Loading history...
50
            ->getReferenceEntityAttributeApi()
51
            ->all($referenceEntityCode, $queryParameters);
52
    }
53
}
54