Skip to content

Commit

Permalink
Added function files to composer.json::autoload.files
Browse files Browse the repository at this point in the history
  • Loading branch information
enobrev committed Sep 1, 2016
1 parent 66d546b commit 9b43f49
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
"autoload": {
"psr-4" : {
"Enobrev\\" : "src/"
}
},
"files": [
"src/Arrays.php",
"src/Debugging.php",
"src/Headers.php",
"src/Strings.php"
]
}
}
16 changes: 16 additions & 0 deletions src/Arrays.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
18 changes: 0 additions & 18 deletions src/array_from_path.php

This file was deleted.

0 comments on commit 9b43f49

Please sign in to comment.