SerializeValueMapper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A valueToArrayIfSet() 0 4 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MaxBeckers\AmazonAlexa\Helper;
6
7
/**
8
 * This trait is helpful for the property to ArrayObject mapping.
9
 */
10
trait SerializeValueMapper
11
{
12 17
    protected function valueToArrayIfSet(\ArrayObject $data, string $property): void
13
    {
14 17
        if (null !== $this->{$property}) {
15 15
            $data[$property] = $this->{$property};
16
        }
17
    }
18
}
19