From 9b43f49457f4ef313f94ce4ed7664127beddea49 Mon Sep 17 00:00:00 2001 From: Mark Armendariz Date: Thu, 1 Sep 2016 06:39:43 -0500 Subject: [PATCH] Added function files to composer.json::autoload.files --- composer.json | 8 +++++++- src/Arrays.php | 16 ++++++++++++++++ src/array_from_path.php | 18 ------------------ 3 files changed, 23 insertions(+), 19 deletions(-) delete mode 100644 src/array_from_path.php diff --git a/composer.json b/composer.json index 68aa6cc..d41ee29 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,12 @@ "autoload": { "psr-4" : { "Enobrev\\" : "src/" - } + }, + "files": [ + "src/Arrays.php", + "src/Debugging.php", + "src/Headers.php", + "src/Strings.php" + ] } } diff --git a/src/Arrays.php b/src/Arrays.php index 35c73cf..b454e25 100644 --- a/src/Arrays.php +++ b/src/Arrays.php @@ -24,4 +24,20 @@ function array_is_multi(array $aArray) { if (is_array($mValue)) return true; } return false; + } + + /** + * @param string $sPath + * @param mixed $mValue + * @param string $sDelimiter + * @return array + */ + function array_from_path($sPath, $mValue, $sDelimiter = '.') { + $aPath = explode($sDelimiter, $sPath); + $aResponse = $mValue; + while(count($aPath) > 1) { + $aResponse = array(array_pop($aPath) => $aResponse); + } + + return $aResponse; } \ No newline at end of file diff --git a/src/array_from_path.php b/src/array_from_path.php deleted file mode 100644 index b6da2c3..0000000 --- a/src/array_from_path.php +++ /dev/null @@ -1,18 +0,0 @@ - 1) { - $aResponse = array(array_pop($aPath) => $aResponse); - } - - return $aResponse; - } \ No newline at end of file