Skip to content

Commit

Permalink
Move Config::append to helper instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 28, 2014
1 parent db720f9 commit 222e5c6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/Illuminate/Support/Facades/Config.php
Expand Up @@ -5,29 +5,6 @@
*/
class Config extends Facade {

/**
* Assign high numeric IDs to a config item to force appending.
*
* @param array $array
* @return array
*/
public static function append(array $array)
{
$start = 9999;

foreach ($array as $key => $value)
{
if (is_numeric($key))
{
$start++;

$array[$start] = array_pull($array, $key);
}
}

return $array;
}

/**
* Get the registered name of the component.
*
Expand Down
26 changes: 26 additions & 0 deletions src/Illuminate/Support/helpers.php
Expand Up @@ -48,6 +48,32 @@ function app_path($path = '')
}
}

if ( ! function_exists('append_config'))
{
/**
* Assign high numeric IDs to a config item to force appending.
*
* @param array $array
* @return array
*/
function append_config(array $array)
{
$start = 9999;

foreach ($array as $key => $value)
{
if (is_numeric($key))
{
$start++;

$array[$start] = array_pull($array, $key);
}
}

return $array;

}

if ( ! function_exists('array_add'))
{
/**
Expand Down

0 comments on commit 222e5c6

Please sign in to comment.