Passed
Push — master ( 669ccb...85dfa5 )
by SignpostMarv
04:19
created

SpeakableSpecification::GetCssSelector()   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\Intangible;
8
9
use SignpostMarv\DaftObject\SchemaOrg\DataTypes\DataType\Text\CssSelectorType;
10
use SignpostMarv\DaftObject\SchemaOrg\DataTypes\DataType\Text\XPathType;
11
use SignpostMarv\DaftObject\SchemaOrg\Intangible as Base;
12
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
13
14
class SpeakableSpecification extends Base
15
{
16
    const SCHEMA_ORG_TYPE = 'SpeakableSpecification';
17
18
    const PROPERTIES = [
19
        'cssSelector',
20
        'xpath',
21
    ];
22
23
    /**
24
    * @return array<int, CssSelectorType>
25
    */
26 3
    public function GetCssSelector() : array
27
    {
28
        /**
29
        * @var array<int, CssSelectorType>
30
        */
31 3
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
32 3
            'cssSelector',
33 3
            $this->RetrievePropertyValueFromData('cssSelector'),
34 3
            static::class
35
        );
36
37 3
        return $out;
38
    }
39
40
    /**
41
    * @param array<int, CssSelectorType> $value
42
    */
43 1
    public function SetCssSelector(array $value) : void
44
    {
45 1
        $this->NudgePropertyWithUniqueValuesOfThings(
46 1
            'cssSelector',
47 1
            __METHOD__,
48 1
            $value,
49 1
            CssSelectorType::class
50
        );
51 1
    }
52
53
    /**
54
    * @return array<int, XPathType>
55
    */
56 3
    public function GetXpath() : array
57
    {
58
        /**
59
        * @var array<int, XPathType>
60
        */
61 3
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
62 3
            'xpath',
63 3
            $this->RetrievePropertyValueFromData('xpath'),
64 3
            static::class
65
        );
66
67 3
        return $out;
68
    }
69
70
    /**
71
    * @param array<int, XPathType> $value
72
    */
73 1
    public function SetXpath(array $value) : void
74
    {
75 1
        $this->NudgePropertyWithUniqueValuesOfThings(
76 1
            'xpath',
77 1
            __METHOD__,
78 1
            $value,
79 1
            XPathType::class
80
        );
81 1
    }
82
}
83