Skip to content

Commit 5d097a1

Browse files
committed
Fix broken docs for array + add validation exception note
1 parent c32f857 commit 5d097a1

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

docs/content/en/index.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Check [Validation documentation](/validation) for more.
6363

6464
### Int
6565

66+
> Throws `ValidationFailedException` if value is not numeric (only on non-null values).
67+
6668
Get nullable int.
6769

6870
```php
@@ -77,6 +79,8 @@ $value = $data->getRequiredInt('key');
7779

7880
### Float
7981

82+
> Throws `ValidationFailedException` if value is not numeric (only on non-null values).
83+
8084
Get nullable float value.
8185

8286
```php
@@ -91,6 +95,8 @@ $value = $data->getRequiredFloat('key');
9195

9296
### Bool
9397

98+
> Throws `ValidationFailedException` if value is not bool (only on non-null values).
99+
94100
Get nullable bool value.
95101

96102
```php
@@ -105,6 +111,8 @@ $value = $data->getRequiredBool('key');
105111

106112
### String
107113

114+
> Throws `ValidationFailedException` if value is not string (only on non-null values).
115+
108116
Get nullable string value.
109117

110118
```php
@@ -119,6 +127,9 @@ $value = $data->getRequiredString('key');
119127

120128
### Date time
121129

130+
> Throws `ValidationFailedException` if value is not string (only on non-null values).
131+
132+
122133
Get nullable `\DateTime` object (return null if empty string).
123134

124135
```php
@@ -133,7 +144,7 @@ $value = $data->getRequiredDateTime('key');
133144

134145
### Array
135146

136-
> Throws always NotAnArrayException exception if value exists but is not an array.
147+
> Throws always `NotAnArrayException` exception if value exists but is not an array.
137148
138149
Get always an array event if provided data is missing or if null.
139150

@@ -144,20 +155,18 @@ $value = $data->getArray('key');
144155
Get nullable array.
145156

146157
```php
147-
$value = $data-> public function getRequiredArray(string $key): array
148-
('key');
158+
$value = $data->getRequiredArray('key');
149159
```
150160

151161
Get required array that is not empty. Throws `ArrayIsEmptyException` exception if missing.
152162

153163
```php
154-
$value = $data-> public function getRequiredArray(string $key): array
155-
('key');
164+
$value = $data->getRequiredArray('key');
156165
```
157166

158167
### GetValue with ArrayData
159168

160-
> Throws always NotAnArrayException exception if value exists but is not an array.
169+
> Throws always `NotAnArrayException` exception if value exists but is not an array.
161170
162171
Try to get nullable array from data and wrap it in `GetValue` instance.
163172

0 commit comments

Comments
 (0)