Passed
Branch fuzzy-generators (db6188)
by SignpostMarv
06:43
created

Comment::SetParentItem()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
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;
8
9
use SignpostMarv\DaftObject\SchemaOrg\CreativeWork as Base;
10
use SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits;
11
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
12
13
/**
14
* @property array<int, int> $downvoteCount
15
* @property array<int, Question> $parentItem
16
* @property array<int, int> $upvoteCount
17
*/
18
class Comment extends Base
19
{
20
    use DaftObjectTraits\UpDownVoteCount;
21
22
    const SCHEMA_ORG_TYPE = 'Comment';
23
24
    const PROPERTIES = [
25
        'downvoteCount',
26
        'parentItem',
27
        'upvoteCount',
28
    ];
29
30
    /**
31
    * @return array<int, Question>
32
    */
33 32
    public function GetParentItem() : array
34
    {
35
        /**
36
        * @var array<int, Question>
37
        */
38 32
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
39 32
            'parentItem',
40 32
            $this->RetrievePropertyValueFromData('parentItem'),
41 32
            static::class
42
        );
43
44 32
        return $out;
45
    }
46
47
    /**
48
    * @param array<int, Question> $value
49
    */
50
    public function SetParentItem(array $value) : void
51
    {
52
        $this->NudgePropertyValue(
53
            'parentItem',
54
            $value
55
        );
56
    }
57
}
58