You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
7
8
+
## [0.10.1] - 2019-09-24
9
+
10
+
### Deprecated
11
+
12
+
- Providing the fields `type` or `id` in a resource not as a string will be throw an ValidationException in v1.0, provide them always as strings instead.
Copy file name to clipboardExpand all lines: src/V1/ResourceIdentifier.php
+12-4Lines changed: 12 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -51,12 +51,20 @@ protected function parse($object)
51
51
thrownewValidationException('A resource object MUST contain an id');
52
52
}
53
53
54
-
if (is_object($object->type) oris_array($object->type)) {
55
-
thrownewValidationException('Resource type cannot be an array or object');
54
+
if (! is_string($object->type)) {
55
+
if (is_object($object->type) oris_array($object->type)) {
56
+
thrownewValidationException('Resource type cannot be an array or object');
57
+
}
58
+
59
+
@trigger_error('Parsing `type` not as string is deprecated since version 0.10.1 and will be throw an Exception in 1.0. Provide `type` always as string instead', E_USER_DEPRECATED);
56
60
}
57
61
58
-
if (is_object($object->id) oris_array($object->id)) {
59
-
thrownewValidationException('Resource Id cannot be an array or object');
62
+
if (! is_string($object->id)) {
63
+
if (is_object($object->id) oris_array($object->id)) {
64
+
thrownewValidationException('Resource Id cannot be an array or object');
65
+
}
66
+
67
+
@trigger_error('Parsing `id` not as string is deprecated since version 0.10.1 and will be throw an Exception in 1.0. Provide `id` always as string instead', E_USER_DEPRECATED);
Copy file name to clipboardExpand all lines: src/V1/ResourceItem.php
+12-4Lines changed: 12 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -48,8 +48,12 @@ protected function parse($object)
48
48
thrownewValidationException('A resource object MUST contain a type');
49
49
}
50
50
51
-
if (is_object($object->type) oris_array($object->type)) {
52
-
thrownewValidationException('Resource type cannot be an array or object');
51
+
if (! is_string($object->type)) {
52
+
if (is_object($object->type) oris_array($object->type)) {
53
+
thrownewValidationException('Resource type cannot be an array or object');
54
+
}
55
+
56
+
@trigger_error('Parsing `type` not as string is deprecated since version 0.10.1 and will be throw an Exception in 1.0. Provide `type` always as string instead', E_USER_DEPRECATED);
53
57
}
54
58
55
59
$this->set('type', strval($object->type));
@@ -62,8 +66,12 @@ protected function parse($object)
62
66
thrownewValidationException('A resource object MUST contain an id');
63
67
}
64
68
65
-
if (is_object($object->id) oris_array($object->id)) {
66
-
thrownewValidationException('Resource id cannot be an array or object');
69
+
if (! is_string($object->id)) {
70
+
if (is_object($object->id) oris_array($object->id)) {
71
+
thrownewValidationException('Resource id cannot be an array or object');
72
+
}
73
+
74
+
@trigger_error('Parsing `id` not as string is deprecated since version 0.10.1 and will be throw an Exception in 1.0. Provide `id` always as string instead', E_USER_DEPRECATED);
0 commit comments