@@ -35,56 +35,56 @@ protected function parse(mixed $object): void
35
35
36
36
foreach (get_object_vars ($ object ) as $ key => $ value ) {
37
37
if ($ key === 'id ' ) {
38
- if (!is_string ($ object -> id )) {
38
+ if (!is_string ($ value )) {
39
39
throw new ValidationException (
40
40
'property "id" has to be a string, " ' .
41
- gettype ($ object -> id ) . '" given. '
41
+ gettype ($ value ) . '" given. '
42
42
);
43
43
}
44
44
45
- $ this ->set ('id ' , strval ($ object -> id ));
45
+ $ this ->set ('id ' , strval ($ value ));
46
46
} elseif ($ key === 'links ' ) {
47
- $ this ->set ('links ' , $ this ->create ('ErrorLink ' , $ object -> links ));
47
+ $ this ->set ('links ' , $ this ->create ('ErrorLink ' , $ value ));
48
48
} elseif ($ key === 'status ' ) {
49
- if (!is_string ($ object -> status )) {
49
+ if (!is_string ($ value )) {
50
50
throw new ValidationException (
51
51
'property "status" has to be a string, " ' .
52
- gettype ($ object -> status ) . '" given. '
52
+ gettype ($ value ) . '" given. '
53
53
);
54
54
}
55
55
56
- $ this ->set ('status ' , strval ($ object -> status ));
56
+ $ this ->set ('status ' , strval ($ value ));
57
57
} elseif ($ key === 'code ' ) {
58
- if (!is_string ($ object -> code )) {
58
+ if (!is_string ($ value )) {
59
59
throw new ValidationException (
60
60
'property "code" has to be a string, " ' .
61
- gettype ($ object -> code ) . '" given. '
61
+ gettype ($ value ) . '" given. '
62
62
);
63
63
}
64
64
65
- $ this ->set ('code ' , strval ($ object -> code ));
65
+ $ this ->set ('code ' , strval ($ value ));
66
66
} elseif ($ key === 'title ' ) {
67
- if (!is_string ($ object -> title )) {
67
+ if (!is_string ($ value )) {
68
68
throw new ValidationException (
69
69
'property "title" has to be a string, " ' .
70
- gettype ($ object -> title ) . '" given. '
70
+ gettype ($ value ) . '" given. '
71
71
);
72
72
}
73
73
74
- $ this ->set ('title ' , strval ($ object -> title ));
74
+ $ this ->set ('title ' , strval ($ value ));
75
75
} elseif ($ key === 'detail ' ) {
76
- if (!is_string ($ object -> detail )) {
76
+ if (!is_string ($ value )) {
77
77
throw new ValidationException (
78
78
'property "detail" has to be a string, " ' .
79
- gettype ($ object -> detail ) . '" given. '
79
+ gettype ($ value ) . '" given. '
80
80
);
81
81
}
82
82
83
- $ this ->set ('detail ' , strval ($ object -> detail ));
83
+ $ this ->set ('detail ' , strval ($ value ));
84
84
} elseif ($ key === 'source ' ) {
85
- $ this ->set ('source ' , $ this ->create ('ErrorSource ' , $ object -> source ));
85
+ $ this ->set ('source ' , $ this ->create ('ErrorSource ' , $ value ));
86
86
} elseif ($ key === 'meta ' ) {
87
- $ this ->set ('meta ' , $ this ->create ('Meta ' , $ object -> meta ));
87
+ $ this ->set ('meta ' , $ this ->create ('Meta ' , $ value ));
88
88
} else {
89
89
$ this ->set ($ key , $ value );
90
90
}
0 commit comments