From 1ebaa4181be765ded972d08f8ca5971d53b5c7b6 Mon Sep 17 00:00:00 2001 From: Quentin Gabriele Date: Sat, 8 Feb 2025 11:41:49 +0100 Subject: [PATCH] fix scalar values --- src/Drivers/PhpDriver.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Drivers/PhpDriver.php b/src/Drivers/PhpDriver.php index 3023fbb..ab793a7 100644 --- a/src/Drivers/PhpDriver.php +++ b/src/Drivers/PhpDriver.php @@ -130,7 +130,7 @@ public function toFile(array $values): string } /** - * @param array $items + * @param array> $items */ public function recursiveToFile( array $items, @@ -157,6 +157,12 @@ public function recursiveToFile( if (is_string($value)) { $value = "'".str_replace('\"', '"', addslashes($value))."'"; + } elseif (is_null($value)) { + $value = 'null'; + } elseif (is_bool($value)) { + $value = $value ? 'true' : 'false'; + } else { + $value = (string) $value; } if (is_string($key)) {