DataFeed   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 42
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A SetDataFeedElement() 0 6 1
A GetDataFeedElement() 0 12 1
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftObject\SchemaOrg\CreativeWork\Dataset;
8
9
use SignpostMarv\DaftObject\SchemaOrg\CreativeWork\Dataset as Base;
10
use SignpostMarv\DaftObject\SchemaOrg\Intangible\DataFeedItem;
11
use SignpostMarv\DaftObject\SchemaOrg\Thing;
12
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
13
14
/**
15
* @property array<int, string|DataFeedItem|Thing> $dataFeedElement
16
*/
17
class DataFeed extends Base
18
{
19
    const SCHEMA_ORG_TYPE = 'DataFeed';
20
21
    const PROPERTIES = [
22
        'dataFeedElement',
23
    ];
24
25
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
26
        'dataFeedElement' => [
27
            'string',
28
            DataFeedItem::class,
29
            Thing::class,
30
        ],
31
    ];
32
33
    /**
34
    * @return array<int, string|DataFeedItem|Thing>
35
    */
36 6
    public function GetDataFeedElement() : array
37
    {
38
        /**
39
        * @var array<int, string|DataFeedItem|Thing>
40
        */
41 6
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
42 6
            'dataFeedElement',
43 6
            $this->RetrievePropertyValueFromData('dataFeedElement'),
44 6
            static::class
45
        );
46
47 6
        return $out;
48
    }
49
50
    /**
51
    * @param array<int, string|DataFeedItem|Thing> $value
52
    */
53 1
    public function SetDataFeedElement(array $value) : void
54
    {
55 1
        $this->NudgePropertyValue(
56 1
            'dataFeedElement',
57 1
            $value,
58 1
            self::BOOL_DEFAULT_AUTOTRIMSTRINGS
59
        );
60 1
    }
61
}
62