Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
JanHuang committed Sep 21, 2017
2 parents ded8d9a + 2d082b8 commit 65532bf
Showing 1 changed file with 31 additions and 24 deletions.
55 changes: 31 additions & 24 deletions helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,41 @@
* @link http://www.fast-d.cn/
*/

/**
* @param $string
* @return \FastD\Utils\StringObject
*/
function stringObject($string = '')
{
return new \FastD\Utils\StringObject($string);
if (!function_exists('stringObject')) {
/**
* @param $string
* @return \FastD\Utils\StringObject
*/
function stringObject($string = '')
{
return new \FastD\Utils\StringObject($string);
}
}

/**
* @param array $array
* @return \FastD\Utils\ArrayObject
*/
function arrayObject(array $array = [])
{
return new \FastD\Utils\ArrayObject($array);
if (!function_exists('arrayObject')) {
/**
* @param array $array
* @return \FastD\Utils\ArrayObject
*/
function arrayObject(array $array = [])
{
return new \FastD\Utils\ArrayObject($array);
}
}

/**
* @param $name
* @param null $value
* @return mixed
*/
function env($name, $value = null)
{
if (null === $value) {
return getenv($name);
if (!function_exists('env')) {
/**
* @param $name
* @param null $value
* @return mixed
*/
function env($name, $value = null)
{
if (null === $value) {
return getenv($name);
}

return putenv(sprintf('%s=%s', $name, $value));
}

return putenv(sprintf('%s=%s', $name, $value));
}

0 comments on commit 65532bf

Please sign in to comment.