Completed
Pull Request — master (#11)
by Oleksandr
41:40 queued 37:09
created

ProductDraftApiAdapter::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
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\Product;
9
10
use Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface;
11
12
class ProductDraftApiAdapter implements ProductDraftApiAdapterInterface
13
{
14
    /**
15
     * @var \Akeneo\Pim\ApiClient\AkeneoPimClientInterface
16
     */
17
    protected $akeneoPimClient;
18
19
    /**
20
     * @param \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface $akeneoPimClient
21
     */
22
    public function __construct(AkeneoPimEnterpriseClientInterface $akeneoPimClient)
23
    {
24
        $this->akeneoPimClient = $akeneoPimClient;
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     *
30
     * @param string $code Code of the resource
31
     *
32
     * @throws \Akeneo\Pim\ApiClient\Exception\HttpException If the request failed.
33
     *
34
     * @return array
35
     */
36
    public function get(string $code): array
37
    {
38
        return $this->akeneoPimClient
39
            ->getProductDraftApi()
0 ignored issues
show
Bug introduced by
The method getProductDraftApi() does not exist on Akeneo\Pim\ApiClient\AkeneoPimClientInterface. Did you maybe mean getProductApi()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

39
            ->/** @scrutinizer ignore-call */ getProductDraftApi()

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
40
            ->get($code);
41
    }
42
}
43