Completed
Push — master ( d8a1ad...d0379b )
by Dominik
02:06
created

FieldDenormalizer::denormalizeField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 3
cts 3
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 5
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\Deserialization\Denormalizer;
6
7
use Chubbyphp\Deserialization\Accessor\AccessorInterface;
8
9
final class FieldDenormalizer implements FieldDenormalizerInterface
10
{
11
    /**
12
     * @var AccessorInterface
13
     */
14
    private $accessor;
15
16
    /**
17
     * @param AccessorInterface $accessor
18
     * @param array             $groups
0 ignored issues
show
Bug introduced by
There is no parameter named $groups. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
19
     */
20 4
    public function __construct(AccessorInterface $accessor)
21
    {
22 4
        $this->accessor = $accessor;
23 4
    }
24
25
    /**
26
     * @param string                            $path
27
     * @param object                            $object
28
     * @param mixed                             $value
29
     * @param DenormalizerInterface|null        $denormalizer
30
     * @param DenormalizerContextInterface|null $context
31
     */
32 4
    public function denormalizeField(
33
        string $path,
34
        $object,
35
        $value,
36
        DenormalizerInterface $denormalizer = null,
37
        DenormalizerContextInterface $context = null
38
    ) {
39 4
        $this->accessor->setValue($object, $value);
40 4
    }
41
}
42