From 880c9310e18d4ab259e6aa8967563b985ae1cad1 Mon Sep 17 00:00:00 2001 From: Matthew Batchelder Date: Wed, 18 Dec 2024 14:55:33 -0500 Subject: [PATCH] Roll back changes to undot because the former was simpler and functional --- src/Arrays/Arr.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/Arrays/Arr.php b/src/Arrays/Arr.php index b0914da..1eb8a65 100644 --- a/src/Arrays/Arr.php +++ b/src/Arrays/Arr.php @@ -1355,21 +1355,7 @@ public static function undot( $array ) { $results = []; foreach ( $array as $key => $value ) { - if ( ! is_string( $key ) ) { - $results[ $key ] = $value; - continue; - } - - $parts = explode('.', $key); - - $current = &$results; - foreach ( $parts as $part ) { - if ( ! isset( $current[ $part ] ) ) { - $current[ $part ] = []; - } - $current = &$current[ $part ]; - } - $current = $value; + $results = static::set( $results, explode( '.', $key ), $value ); } return $results;