Skip to content

Commit

Permalink
rename helper to filled
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Aug 29, 2017
1 parent a1e126b commit 31308e3
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/Illuminate/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,21 @@ function env($key, $default = null)
}
}

if (! function_exists('filled')) {
/**
* Determine if a value is "filled".
*
* @author Derek MacDonald (https://github.com/derekmd)
*
* @param mixed $value
* @return bool
*/
function filled($value)
{
return ! blank($value);
}
}

if (! function_exists('head')) {
/**
* Get the first element of an array. Useful for method chaining.
Expand Down Expand Up @@ -731,21 +746,6 @@ function preg_replace_array($pattern, array $replacements, $subject)
}
}

if (! function_exists('present')) {
/**
* Determine if a value is "present".
*
* @author Derek MacDonald (https://github.com/derekmd)
*
* @param mixed $value
* @return bool
*/
function present($value)
{
return ! blank($value);
}
}

if (! function_exists('retry')) {
/**
* Retry an operation a given number of times.
Expand Down Expand Up @@ -1121,7 +1121,7 @@ function trait_uses_recursive($trait)
*/
function transform($value, callable $callback, $default = null)
{
if (present($value)) {
if (filled($value)) {
return $callback($value);
}

Expand Down

0 comments on commit 31308e3

Please sign in to comment.