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

SpeakableSpecification::SetXpath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 7
ccs 0
cts 6
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\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 1
    public function GetCssSelector() : array
27
    {
28
        /**
29
        * @var array<int, CssSelectorType>
30
        */
31 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
32 1
            'cssSelector',
33 1
            $this->RetrievePropertyValueFromData('cssSelector'),
34 1
            static::class
35
        );
36
37 1
        return $out;
38
    }
39
40
    /**
41
    * @param array<int, CssSelectorType> $value
42
    */
43
    public function SetCssSelector(array $value) : void
44
    {
45
        $this->NudgePropertyWithUniqueValuesOfThings(
46
            'cssSelector',
47
            __METHOD__,
48
            $value,
49
            CssSelectorType::class
50
        );
51
    }
52
53
    /**
54
    * @return array<int, XPathType>
55
    */
56 1
    public function GetXpath() : array
57
    {
58
        /**
59
        * @var array<int, XPathType>
60
        */
61 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
62 1
            'xpath',
63 1
            $this->RetrievePropertyValueFromData('xpath'),
64 1
            static::class
65
        );
66
67 1
        return $out;
68
    }
69
70
    /**
71
    * @param array<int, XPathType> $value
72
    */
73
    public function SetXpath(array $value) : void
74
    {
75
        $this->NudgePropertyWithUniqueValuesOfThings(
76
            'xpath',
77
            __METHOD__,
78
            $value,
79
            XPathType::class
80
        );
81
    }
82
}
83