Skip to content

Commit 6cfe6ef

Browse files
committed
fix array
1 parent d043a32 commit 6cfe6ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/GenericInstance.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private function castAttribute(GenericProperty $property, $value)
104104
return $value;
105105
}
106106

107-
if ($property->isArray() && is_array($value)) {
107+
if ($property->isArray()) {
108108
return $this->castArray($property, $value);
109109
}
110110

@@ -124,12 +124,12 @@ private function castAttribute(GenericProperty $property, $value)
124124

125125
/**
126126
* @param GenericProperty $property
127-
* @param array<mixed> $value
127+
* @param array<mixed>|mixed $value
128128
*
129-
* @return array<mixed>
129+
* @return array<mixed>|mixed
130130
* @throws ClassNotFoundException
131131
*/
132-
private function castArray(GenericProperty $property, array $value): array
132+
private function castArray(GenericProperty $property, $value): mixed
133133
{
134134
$arrayTypeAttr = $property->getAttribute(ConvertArray::class);
135135
if ($arrayTypeAttr !== null) {

0 commit comments

Comments
 (0)