From a15f44e79aeecefaa3a1ba6e67aa3b56f05f0b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Sun, 15 Dec 2024 15:42:52 +0100 Subject: [PATCH 1/2] Fix php84 `str_getcsv` deprecation in DataStructure.php > As of PHP 8.4.0, depending on the default value of escape is deprecated. It needs to be provided explicitly either positionally or by the use of named arguments. https://www.php.net/manual/en/function.str-getcsv.php A very minimal patch/quick fix.. tell me if you want anything --- src/MartinGeorgiev/Utils/DataStructure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MartinGeorgiev/Utils/DataStructure.php b/src/MartinGeorgiev/Utils/DataStructure.php index b4f785d2..7a5681d2 100644 --- a/src/MartinGeorgiev/Utils/DataStructure.php +++ b/src/MartinGeorgiev/Utils/DataStructure.php @@ -26,7 +26,7 @@ public static function transformPostgresTextArrayToPHPArray(string $postgresArra throw new \InvalidArgumentException('Only single-dimensioned arrays are supported'); } - $phpArray = \str_getcsv(\trim($textArrayToTransform, '{}')); + $phpArray = \str_getcsv(\trim($textArrayToTransform, '{}'), escape: ''); foreach ($phpArray as $i => $text) { if ($text === null) { unset($phpArray[$i]); From 93b806ea757f0303f56d84360d01e18c1c8f8ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Tue, 17 Dec 2024 01:51:10 +0100 Subject: [PATCH 2/2] set current default value --- src/MartinGeorgiev/Utils/DataStructure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MartinGeorgiev/Utils/DataStructure.php b/src/MartinGeorgiev/Utils/DataStructure.php index 7a5681d2..cdbcc7ac 100644 --- a/src/MartinGeorgiev/Utils/DataStructure.php +++ b/src/MartinGeorgiev/Utils/DataStructure.php @@ -26,7 +26,7 @@ public static function transformPostgresTextArrayToPHPArray(string $postgresArra throw new \InvalidArgumentException('Only single-dimensioned arrays are supported'); } - $phpArray = \str_getcsv(\trim($textArrayToTransform, '{}'), escape: ''); + $phpArray = \str_getcsv(\trim($textArrayToTransform, '{}'), escape: '\\'); foreach ($phpArray as $i => $text) { if ($text === null) { unset($phpArray[$i]);