|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @author SignpostMarv |
|
4
|
|
|
*/ |
|
5
|
|
|
declare(strict_types=1); |
|
6
|
|
|
|
|
7
|
|
|
namespace SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits; |
|
8
|
|
|
|
|
9
|
|
|
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue; |
|
10
|
|
|
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities; |
|
11
|
|
|
|
|
12
|
|
|
trait HasMinMaxValue |
|
13
|
|
|
{ |
|
14
|
|
|
use DaftObjectTrait; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* @return array<int, float|int> |
|
18
|
|
|
*/ |
|
19
|
246 |
|
public function GetMaxValue() : array |
|
20
|
|
|
{ |
|
21
|
|
|
/** |
|
22
|
|
|
* @var array<int, float|int> |
|
23
|
|
|
*/ |
|
24
|
246 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
25
|
246 |
|
'maxValue', |
|
26
|
246 |
|
$this->RetrievePropertyValueFromData('maxValue'), |
|
|
|
|
|
|
27
|
246 |
|
static::class |
|
28
|
|
|
); |
|
29
|
|
|
|
|
30
|
246 |
|
return $out; |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @param array<int, float|int> $value |
|
35
|
|
|
*/ |
|
36
|
8 |
|
public function SetMaxValue(array $value) : void |
|
37
|
|
|
{ |
|
38
|
8 |
|
$this->NudgePropertyWithUniqueIntegersOrFloats('maxValue', __METHOD__, $value); |
|
|
|
|
|
|
39
|
8 |
|
} |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @return array<int, float|int> |
|
43
|
|
|
*/ |
|
44
|
246 |
|
public function GetMinValue() : array |
|
45
|
|
|
{ |
|
46
|
|
|
/** |
|
47
|
|
|
* @var array<int, float|int> |
|
48
|
|
|
*/ |
|
49
|
246 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
50
|
246 |
|
'minValue', |
|
51
|
246 |
|
$this->RetrievePropertyValueFromData('minValue'), |
|
52
|
246 |
|
static::class |
|
53
|
|
|
); |
|
54
|
|
|
|
|
55
|
246 |
|
return $out; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @param array<int, float|int> $value |
|
60
|
|
|
*/ |
|
61
|
8 |
|
public function SetMinValue(array $value) : void |
|
62
|
|
|
{ |
|
63
|
8 |
|
$this->NudgePropertyWithUniqueIntegersOrFloats('minValue', __METHOD__, $value); |
|
64
|
8 |
|
} |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @return array<int, bool|string|int|float|StructuredValue> |
|
68
|
|
|
*/ |
|
69
|
246 |
|
public function GetValue() : array |
|
70
|
|
|
{ |
|
71
|
|
|
/** |
|
72
|
|
|
* @var array<int, bool|string|int|float|StructuredValue> |
|
73
|
|
|
*/ |
|
74
|
246 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
75
|
246 |
|
'value', |
|
76
|
246 |
|
$this->RetrievePropertyValueFromData('value'), |
|
77
|
246 |
|
static::class |
|
78
|
|
|
); |
|
79
|
|
|
|
|
80
|
246 |
|
return $out; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* @param array<int, bool|string|int|float|StructuredValue> $value |
|
85
|
|
|
*/ |
|
86
|
8 |
|
public function SetValue(array $value) : void |
|
87
|
|
|
{ |
|
88
|
8 |
|
$this->NudgePropertyValue('value', $value, true); |
|
89
|
8 |
|
} |
|
90
|
|
|
} |
|
91
|
|
|
|