HasAward   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A SetAward() 0 6 1
A GetAward() 0 12 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\Thing;
10
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
11
12
trait HasAward
13
{
14
    use DaftObjectTrait;
15
16
    /**
17
    * @return array<int, string>
18
    */
19 246
    public function GetAward() : array
20
    {
21
        /**
22
        * @var array<int, string>
23
        */
24 246
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
25 246
            'award',
26 246
            $this->RetrievePropertyValueFromData('award'),
27 246
            static::class
28
        );
29
30 246
        return $out;
31
    }
32
33
    /**
34
    * @param array<int, string> $value
35
    */
36 38
    public function SetAward(array $value) : void
37
    {
38 38
        $this->NudgePropertyValue(
39 38
            'award',
40 38
            $value,
41 38
            Thing::BOOL_DEFAULT_AUTOTRIMSTRINGS
42
        );
43 38
    }
44
}
45