MediaSubscription::SetExpectsAcceptanceOf()   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\Intangible;
8
9
use SignpostMarv\DaftObject\SchemaOrg\Intangible as Base;
10
use SignpostMarv\DaftObject\SchemaOrg\Offer;
11
use SignpostMarv\DaftObject\SchemaOrg\Organization;
12
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
13
14
/**
15
* @property array<int, Organization> $authenticator
16
* @property array<int, Offer> $expectsAcceptanceOf
17
*/
18
class MediaSubscription extends Base
19
{
20
    const SCHEMA_ORG_TYPE = 'MediaSubscription';
21
22
    const PROPERTIES = [
23
        'authenticator',
24
        'expectsAcceptanceOf',
25
    ];
26
27
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
28
        'authenticator' => [
29
            Organization::class,
30
        ],
31
        'expectsAcceptanceOf' => [
32
            Offer::class,
33
        ],
34
    ];
35
36
    /**
37
    * @return array<int, Organization>
38
    */
39 8
    public function GetAuthenticator() : array
40
    {
41
        /**
42
        * @var array<int, Organization>
43
        */
44 8
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
45 8
            'authenticator',
46 8
            $this->RetrievePropertyValueFromData('authenticator'),
47 8
            static::class
48
        );
49
50 8
        return $out;
51
    }
52
53
    /**
54
    * @param array<int, Organization> $value
55
    */
56 1
    public function SetAuthenticator(array $value) : void
57
    {
58 1
        $this->NudgePropertyValue(
59 1
            'authenticator',
60 1
            $value
61
        );
62 1
    }
63
64
    /**
65
    * @return array<int, Offer>
66
    */
67 8
    public function GetExpectsAcceptanceOf() : array
68
    {
69
        /**
70
        * @var array<int, Offer>
71
        */
72 8
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
73 8
            'expectsAcceptanceOf',
74 8
            $this->RetrievePropertyValueFromData('expectsAcceptanceOf'),
75 8
            static::class
76
        );
77
78 8
        return $out;
79
    }
80
81
    /**
82
    * @param array<int, Offer> $value
83
    */
84 1
    public function SetExpectsAcceptanceOf(array $value) : void
85
    {
86 1
        $this->NudgePropertyValue(
87 1
            'expectsAcceptanceOf',
88 1
            $value
89
        );
90 1
    }
91
}
92