Passed
Push — master ( df1a48...669ccb )
by SignpostMarv
04:37
created

PublicationEvent::GetPublishedOn()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 12
ccs 6
cts 6
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\Event;
8
9
use SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits;
10
use SignpostMarv\DaftObject\SchemaOrg\Event as Base;
11
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Service\BroadcastService;
12
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
13
14
class PublicationEvent extends Base
15
{
16
    use DaftObjectTraits\HasIsAccessibleForFree;
17
18
    const SCHEMA_ORG_TYPE = 'PublicationEvent';
19
20
    const PROPERTIES = [
21
        'isAccessibleForFree',
22
        'publishedBy',
23
        'publishedOn',
24
    ];
25
26
    /**
27
    * @return array<int, \SignpostMarv\DaftObject\SchemaOrg\Organization|\SignpostMarv\DaftObject\SchemaOrg\Person>
28
    */
29 5
    public function GetPublishedBy() : array
30
    {
31
        /**
32
        * @var array<int, \SignpostMarv\DaftObject\SchemaOrg\Organization|\SignpostMarv\DaftObject\SchemaOrg\Person>
33
        */
34 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
35 5
            'publishedBy',
36 5
            $this->RetrievePropertyValueFromData('publishedBy'),
37 5
            static::class
38
        );
39
40 5
        return $out;
41
    }
42
43
    /**
44
    * @param array<int, \SignpostMarv\DaftObject\SchemaOrg\Organization|\SignpostMarv\DaftObject\SchemaOrg\Person> $value
45
    */
46 1
    public function SetPublishedBy(array $value) : void
47
    {
48 1
        $this->NudgePropertyWithUniqueOrganizationsOrPersons('publishedBy', __METHOD__, $value);
49 1
    }
50
51
    /**
52
    * @return array<int, BroadcastService>
53
    */
54 4
    public function GetPublishedOn() : array
55
    {
56
        /**
57
        * @var array<int, BroadcastService>
58
        */
59 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
60 4
            'publishedOn',
61 4
            $this->RetrievePropertyValueFromData('publishedOn'),
62 4
            static::class
63
        );
64
65 4
        return $out;
66
    }
67
68
    /**
69
    * @param array<int, BroadcastService> $value
70
    */
71
    public function SetPublishedOn(array $value) : void
72
    {
73
        $this->NudgePropertyWithUniqueValuesOfThings(
74
            'publishedOn',
75
            __METHOD__,
76
            $value,
77
            BroadcastService::class
78
        );
79
    }
80
}
81