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

Comment   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 37
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A GetParentItem() 0 12 1
A SetParentItem() 0 5 1
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 11
    public function GetParentItem() : array
34
    {
35
        /**
36
        * @var array<int, Question>
37
        */
38 11
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
39 11
            'parentItem',
40 11
            $this->RetrievePropertyValueFromData('parentItem'),
41 11
            static::class
42
        );
43
44 11
        return $out;
45
    }
46
47
    /**
48
    * @param array<int, Question> $value
49
    */
50 4
    public function SetParentItem(array $value) : void
51
    {
52 4
        $this->NudgePropertyValue(
53 4
            'parentItem',
54 4
            $value
55
        );
56 4
    }
57
}
58