Skip to content

Commit

Permalink
Use value helper where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
netpok committed Sep 11, 2019
1 parent 22acfc5 commit afab240
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Console/ConfirmableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function confirmToProceed($warning = 'Application In Production!', $callb
{
$callback = is_null($callback) ? $this->getDefaultConfirmCallback() : $callback;

$shouldConfirm = $callback instanceof Closure ? $callback() : $callback;
$shouldConfirm = value($callback);

if ($shouldConfirm) {
if ($this->hasOption('force') && $this->option('force')) {
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Container/BoundMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected static function callClass($container, $target, array $parameters = [],
protected static function callBoundMethod($container, $callback, $default)
{
if (! is_array($callback)) {
return $default instanceof Closure ? $default() : $default;
return value($default);
}

// Here we need to turn the array callable into a Class@method string we can use to
Expand All @@ -87,7 +87,7 @@ protected static function callBoundMethod($container, $callback, $default)
return $container->callMethodBinding($method, $callback[0]);
}

return $default instanceof Closure ? $default() : $default;
return value($default);
}

/**
Expand Down

0 comments on commit afab240

Please sign in to comment.