TraitAdditionalProperty   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 29
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A GetAdditionalProperty() 0 12 1
A SetAdditionalProperty() 0 5 1
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits;
8
9
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\PropertyValue;
10
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
11
12
trait TraitAdditionalProperty
13
{
14
    use DaftObjectTrait;
15
16
    /**
17
    * @return array<int, PropertyValue>
18
    */
19 91
    public function GetAdditionalProperty() : array
20
    {
21
        /**
22
        * @var array<int, PropertyValue>
23
        */
24 91
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
25 91
            'additionalProperty',
26 91
            $this->RetrievePropertyValueFromData('additionalProperty'),
27 91
            static::class
28
        );
29
30 91
        return $out;
31
    }
32
33
    /**
34
    * @param array<int, PropertyValue> $value
35
    */
36 8
    public function SetAdditionalProperty(array $value) : void
37
    {
38 8
        $this->NudgePropertyValue(
39 8
            'additionalProperty',
40 8
            $value
41
        );
42 8
    }
43
}
44