Passed
Pull Request — master (#33)
by Aleksey
09:12 queued 01:09
created

ComputopToUtilEncodingServiceBridge   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A encodeJson() 0 3 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\Computop\Dependency\Service;
9
10
class ComputopToUtilEncodingServiceBridge implements ComputopToUtilEncodingServiceInterface
11
{
12
    /**
13
     * @var \Spryker\Client\Calculation\CalculationClientInterface
14
     */
15
    protected $utilEncodingService;
16
17
    /**
18
     * @param \Spryker\Service\UtilEncoding\UtilEncodingServiceInterface $utilEncodingService
19
     */
20
    public function __construct($utilEncodingService)
21
    {
22
        $this->utilEncodingService = $utilEncodingService;
0 ignored issues
show
Documentation Bug introduced by
It seems like $utilEncodingService of type Spryker\Service\UtilEnco...ncodingServiceInterface is incompatible with the declared type Spryker\Client\Calculati...culationClientInterface of property $utilEncodingService.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
23
    }
24
25
    /**
26
     * @param array $value
27
     * @param int|null $options
28
     * @param int|null $depth
29
     *
30
     * @return string|null
31
     */
32
    public function encodeJson($value, $options = null, $depth = null)
33
    {
34
        return $this->utilEncodingService->encodeJson($value, $options, $depth);
0 ignored issues
show
Bug introduced by
The method encodeJson() does not exist on Spryker\Client\Calculati...culationClientInterface. ( Ignorable by Annotation )

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

34
        return $this->utilEncodingService->/** @scrutinizer ignore-call */ encodeJson($value, $options, $depth);

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...
35
    }
36
}
37