Test Failed
Push — master ( 4486b3...16bdc1 )
by SignpostMarv
02:20
created

MusicAlbum::SetByArtist()   A

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\CreativeWork\MusicPlaylist;
8
9
use SignpostMarv\DaftObject\SchemaOrg\CreativeWork\MusicPlaylist as Base;
10
use SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits;
11
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Enumeration\MusicAlbumProductionType;
12
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Enumeration\MusicAlbumReleaseType;
13
use SignpostMarv\DaftObject\SchemaOrg\Organization\PerformingGroup\MusicGroup;
14
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
15
16
/**
17
* @property array<int, MusicAlbumProductionType> $albumProductionType
18
* @property array<int, MusicRelease> $albumRelease
19
* @property array<int, MusicAlbumReleaseType> $albumReleaseType
20
* @property array<int, MusicGroup> $byArtist
21
*/
22
class MusicAlbum extends Base
23
{
24
    use DaftObjectTraits\ByArtist;
25
26
    const SCHEMA_ORG_TYPE = 'MusicAlbum';
27
28
    const PROPERTIES = [
29
        'albumProductionType',
30
        'albumRelease',
31
        'albumReleaseType',
32
        'byArtist',
33
    ];
34
35
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
36
        'albumProductionType' => [
37
            MusicAlbumProductionType::class,
38
        ],
39
        'albumRelease' => [
40
            MusicRelease::class,
41
        ],
42
        'albumReleaseType' => [
43
            MusicAlbumReleaseType::class,
44
        ],
45
        'byArtist' => [
46
            MusicGroup::class,
47
        ],
48
    ];
49
50 8
    /**
51
    * @return array<int, MusicAlbumProductionType>
52
    */
53
    public function GetAlbumProductionType() : array
54
    {
55 8
        /**
56 8
        * @var array<int, MusicAlbumProductionType>
57 8
        */
58 8
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
59
            'albumProductionType',
60
            $this->RetrievePropertyValueFromData('albumProductionType'),
61 8
            static::class
62
        );
63
64
        return $out;
65
    }
66
67 1
    /**
68
    * @param array<int, MusicAlbumProductionType> $value
69 1
    */
70 1
    public function SetAlbumProductionType(array $value) : void
71 1
    {
72
        $this->NudgePropertyValue(
73 1
            'albumProductionType',
74
            $value
75
        );
76
    }
77
78 8
    /**
79
    * @return array<int, MusicRelease>
80
    */
81
    public function GetAlbumRelease() : array
82
    {
83 8
        /**
84 8
        * @var array<int, MusicRelease>
85 8
        */
86 8
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
87
            'albumRelease',
88
            $this->RetrievePropertyValueFromData('albumRelease'),
89 8
            static::class
90
        );
91
92
        return $out;
93
    }
94
95 1
    /**
96
    * @param array<int, MusicRelease> $value
97 1
    */
98 1
    public function SetAlbumRelease(array $value) : void
99 1
    {
100
        $this->NudgePropertyValue(
101 1
            'albumRelease',
102
            $value
103
        );
104
    }
105
106 8
    /**
107
    * @return array<int, MusicAlbumReleaseType>
108
    */
109
    public function GetAlbumReleaseType() : array
110
    {
111 8
        /**
112 8
        * @var array<int, MusicAlbumReleaseType>
113 8
        */
114 8
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
115
            'albumReleaseType',
116
            $this->RetrievePropertyValueFromData('albumReleaseType'),
117 8
            static::class
118
        );
119
120
        return $out;
121
    }
122
123 1
    /**
124
    * @param array<int, MusicAlbumReleaseType> $value
125 1
    */
126 1
    public function SetAlbumReleaseType(array $value) : void
127 1
    {
128
        $this->NudgePropertyValue(
129 1
            'albumReleaseType',
130
            $value
131
        );
132
    }
133
}
134