HasMakesOffer::SetMakesOffer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
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\Offer;
10
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
11
12
trait HasMakesOffer
13
{
14
    use DaftObjectTrait;
15
16
    /**
17
    * @return array<int, Offer>
18
    */
19 70
    public function GetMakesOffer() : array
20
    {
21
        /**
22
        * @var array<int, Offer>
23
        */
24 70
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
25 70
            'makesOffer',
26 70
            $this->RetrievePropertyValueFromData('makesOffer'),
27 70
            static::class
28
        );
29
30 70
        return $out;
31
    }
32
33
    /**
34
    * @param array<int, Offer> $value
35
    */
36 3
    public function SetMakesOffer(array $value) : void
37
    {
38 3
        $this->NudgePropertyValue(
39 3
            'makesOffer',
40 3
            $value
41
        );
42 3
    }
43
}
44