-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathAXValueSource.php
More file actions
144 lines (130 loc) · 3.03 KB
/
AXValueSource.php
File metadata and controls
144 lines (130 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
namespace ChromeDevtoolsProtocol\Model\Accessibility;
/**
* A single source for a computed AX property.
*
* @generated This file has been auto-generated, do not edit.
*
* @author Jakub Kulhan <jakub.kulhan@gmail.com>
*/
final class AXValueSource implements \JsonSerializable
{
/**
* What type of source this is.
*
* @var string
*/
public $type;
/**
* The value of this property source.
*
* @var AXValue|null
*/
public $value;
/**
* The name of the relevant attribute, if any.
*
* @var string|null
*/
public $attribute;
/**
* The value of the relevant attribute, if any.
*
* @var AXValue|null
*/
public $attributeValue;
/**
* Whether this source is superseded by a higher priority source.
*
* @var bool|null
*/
public $superseded;
/**
* The native markup source for this value, e.g. a <label> element.
*
* @var string
*/
public $nativeSource;
/**
* The value, such as a node or node list, of the native source.
*
* @var AXValue|null
*/
public $nativeSourceValue;
/**
* Whether the value for this property is invalid.
*
* @var bool|null
*/
public $invalid;
/**
* Reason for the value being invalid, if it is.
*
* @var string|null
*/
public $invalidReason;
public static function fromJson($data)
{
$instance = new static();
if (isset($data->type)) {
$instance->type = (string)$data->type;
}
if (isset($data->value)) {
$instance->value = AXValue::fromJson($data->value);
}
if (isset($data->attribute)) {
$instance->attribute = (string)$data->attribute;
}
if (isset($data->attributeValue)) {
$instance->attributeValue = AXValue::fromJson($data->attributeValue);
}
if (isset($data->superseded)) {
$instance->superseded = (bool)$data->superseded;
}
if (isset($data->nativeSource)) {
$instance->nativeSource = (string)$data->nativeSource;
}
if (isset($data->nativeSourceValue)) {
$instance->nativeSourceValue = AXValue::fromJson($data->nativeSourceValue);
}
if (isset($data->invalid)) {
$instance->invalid = (bool)$data->invalid;
}
if (isset($data->invalidReason)) {
$instance->invalidReason = (string)$data->invalidReason;
}
return $instance;
}
public function jsonSerialize(): mixed
{
$data = new \stdClass();
if ($this->type !== null) {
$data->type = $this->type;
}
if ($this->value !== null) {
$data->value = $this->value->jsonSerialize();
}
if ($this->attribute !== null) {
$data->attribute = $this->attribute;
}
if ($this->attributeValue !== null) {
$data->attributeValue = $this->attributeValue->jsonSerialize();
}
if ($this->superseded !== null) {
$data->superseded = $this->superseded;
}
if ($this->nativeSource !== null) {
$data->nativeSource = $this->nativeSource;
}
if ($this->nativeSourceValue !== null) {
$data->nativeSourceValue = $this->nativeSourceValue->jsonSerialize();
}
if ($this->invalid !== null) {
$data->invalid = $this->invalid;
}
if ($this->invalidReason !== null) {
$data->invalidReason = $this->invalidReason;
}
return $data;
}
}