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