Skip to content

Commit 45d3997

Browse files
committed
Fix phpstan errors
1 parent 4be2ed1 commit 45d3997

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/V1/Error.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,56 +35,56 @@ protected function parse(mixed $object): void
3535

3636
foreach (get_object_vars($object) as $key => $value) {
3737
if ($key === 'id') {
38-
if (!is_string($object->id)) {
38+
if (!is_string($value)) {
3939
throw new ValidationException(
4040
'property "id" has to be a string, "' .
41-
gettype($object->id) . '" given.'
41+
gettype($value) . '" given.'
4242
);
4343
}
4444

45-
$this->set('id', strval($object->id));
45+
$this->set('id', strval($value));
4646
} elseif ($key === 'links') {
47-
$this->set('links', $this->create('ErrorLink', $object->links));
47+
$this->set('links', $this->create('ErrorLink', $value));
4848
} elseif ($key === 'status') {
49-
if (!is_string($object->status)) {
49+
if (!is_string($value)) {
5050
throw new ValidationException(
5151
'property "status" has to be a string, "' .
52-
gettype($object->status) . '" given.'
52+
gettype($value) . '" given.'
5353
);
5454
}
5555

56-
$this->set('status', strval($object->status));
56+
$this->set('status', strval($value));
5757
} elseif ($key === 'code') {
58-
if (!is_string($object->code)) {
58+
if (!is_string($value)) {
5959
throw new ValidationException(
6060
'property "code" has to be a string, "' .
61-
gettype($object->code) . '" given.'
61+
gettype($value) . '" given.'
6262
);
6363
}
6464

65-
$this->set('code', strval($object->code));
65+
$this->set('code', strval($value));
6666
} elseif ($key === 'title') {
67-
if (!is_string($object->title)) {
67+
if (!is_string($value)) {
6868
throw new ValidationException(
6969
'property "title" has to be a string, "' .
70-
gettype($object->title) . '" given.'
70+
gettype($value) . '" given.'
7171
);
7272
}
7373

74-
$this->set('title', strval($object->title));
74+
$this->set('title', strval($value));
7575
} elseif ($key === 'detail') {
76-
if (!is_string($object->detail)) {
76+
if (!is_string($value)) {
7777
throw new ValidationException(
7878
'property "detail" has to be a string, "' .
79-
gettype($object->detail) . '" given.'
79+
gettype($value) . '" given.'
8080
);
8181
}
8282

83-
$this->set('detail', strval($object->detail));
83+
$this->set('detail', strval($value));
8484
} elseif ($key === 'source') {
85-
$this->set('source', $this->create('ErrorSource', $object->source));
85+
$this->set('source', $this->create('ErrorSource', $value));
8686
} elseif ($key === 'meta') {
87-
$this->set('meta', $this->create('Meta', $object->meta));
87+
$this->set('meta', $this->create('Meta', $value));
8888
} else {
8989
$this->set($key, $value);
9090
}

0 commit comments

Comments
 (0)