Passed
Push — master ( 6d0f47...81601f )
by SignpostMarv
12:06
created

FinancialProduct   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 112
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 46
dl 0
loc 112
ccs 37
cts 37
cp 1
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A SetFeesAndCommissionsSpecification() 0 6 1
A GetFeesAndCommissionsSpecification() 0 12 1
A SetInterestRate() 0 7 1
A GetAnnualPercentageRate() 0 12 1
A GetInterestRate() 0 12 1
A SetAnnualPercentageRate() 0 7 1
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftObject\SchemaOrg\Intangible\Service;
8
9
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Service as Base;
10
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\QuantitativeValue;
11
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
12
13
/**
14
* @property array<int, int|float|QuantitativeValue> $annualPercentageRate
15
* @property array<int, string> $feesAndCommissionsSpecification
16
* @property array<int, int|float|QuantitativeValue> $interestRate
17
*/
18
class FinancialProduct extends Base
19
{
20
    const SCHEMA_ORG_TYPE = 'FinancialProduct';
21
22
    const PROPERTIES = [
23
        'annualPercentageRate',
24
        'feesAndCommissionsSpecification',
25
        'interestRate',
26
    ];
27
28
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
29
        'annualPercentageRate' => [
30
            'integer',
31
            'double',
32
            QuantitativeValue::class,
33
        ],
34
        'feesAndCommissionsSpecification' => [
35
            'string',
36
        ],
37
        'interestRate' => [
38
            'integer',
39
            'double',
40
            QuantitativeValue::class,
41
        ],
42
    ];
43
44
    /**
45
    * @return array<int, int|float|QuantitativeValue>
46
    */
47 10
    public function GetAnnualPercentageRate() : array
48
    {
49
        /**
50
        * @var array<int, int|float|QuantitativeValue>
51
        */
52 10
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
53 10
            'annualPercentageRate',
54 10
            $this->RetrievePropertyValueFromData('annualPercentageRate'),
55 10
            static::class
56
        );
57
58 10
        return $out;
59
    }
60
61
    /**
62
    * @param array<int, int|float|QuantitativeValue> $value
63
    */
64 3
    public function SetAnnualPercentageRate(array $value) : void
65
    {
66 3
        $this->NudgePropertyWithUniqueNumericsOrThings(
67 3
            'annualPercentageRate',
68 3
            __METHOD__,
69 3
            $value,
70 3
            QuantitativeValue::class
71
        );
72 3
    }
73
74
    /**
75
    * @return array<int, string>
76
    */
77 10
    public function GetFeesAndCommissionsSpecification() : array
78
    {
79
        /**
80
        * @var array<int, string>
81
        */
82 10
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
83 10
            'feesAndCommissionsSpecification',
84 10
            $this->RetrievePropertyValueFromData('feesAndCommissionsSpecification'),
85 10
            static::class
86
        );
87
88 10
        return $out;
89
    }
90
91
    /**
92
    * @param array<int, string> $value
93
    */
94 3
    public function SetFeesAndCommissionsSpecification(array $value) : void
95
    {
96 3
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
97 3
            'feesAndCommissionsSpecification',
98 3
            __METHOD__,
99 3
            $value
100
        );
101 3
    }
102
103
    /**
104
    * @return array<int, int|float|QuantitativeValue>
105
    */
106 10
    public function GetInterestRate() : array
107
    {
108
        /**
109
        * @var array<int, int|float|QuantitativeValue>
110
        */
111 10
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
112 10
            'interestRate',
113 10
            $this->RetrievePropertyValueFromData('interestRate'),
114 10
            static::class
115
        );
116
117 10
        return $out;
118
    }
119
120
    /**
121
    * @param array<int, int|float|QuantitativeValue> $value
122
    */
123 3
    public function SetInterestRate(array $value) : void
124
    {
125 3
        $this->NudgePropertyWithUniqueNumericsOrThings(
126 3
            'interestRate',
127 3
            __METHOD__,
128 3
            $value,
129 3
            QuantitativeValue::class
130
        );
131 3
    }
132
}
133