Skip to content

Commit 746f8bf

Browse files
author
Vincent Chalnot
committed
Fixing value type check in ConvertValueTransformer, array values where producing weird bugs in production
1 parent d774afc commit 746f8bf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Transformer/ConvertValueTransformer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ public function transform($value, array $options = [])
4444
"Value of type {$type} is not a valid array index, set auto_cast to true to cast it to a string"
4545
);
4646
}
47+
if (is_array($value)) { // Array to string conversion is a simple notice so we need to catch it here
48+
throw new \UnexpectedValueException(
49+
"Unexpected input of type 'array' in convert_value transformer"
50+
);
51+
}
4752
$value = (string) $value; // Let's cast it to string
4853
}
4954

0 commit comments

Comments
 (0)