Commit fb3a0df0 authored by Taylor Otwell's avatar Taylor Otwell

change is_callable checks to instanceof Closure.

parent 429c9cee
......@@ -27,7 +27,7 @@ class Arr {
{
if ( ! is_array($array) or ! array_key_exists($segment, $array))
{
return is_callable($default) ? call_user_func($default) : $default;
return ($default instanceof \Closure) ? call_user_func($default) : $default;
}
$array = $array[$segment];
......
......@@ -38,7 +38,7 @@ abstract class Driver {
{
if ( ! is_null($item = $this->retrieve($key))) return $item;
return (is_callable($default)) ? call_user_func($default) : $default;
return ($default instanceof \Closure) ? call_user_func($default) : $default;
}
/**
......@@ -82,7 +82,7 @@ abstract class Driver {
{
if ( ! is_null($item = $this->get($key, null))) return $item;
$default = is_callable($default) ? call_user_func($default) : $default;
$default = ($default instanceof \Closure) ? call_user_func($default) : $default;
$this->put($key, $default, $minutes);
......
......@@ -58,7 +58,7 @@ class Config {
if ( ! static::load($file))
{
return is_callable($default) ? call_user_func($default) : $default;
return ($default instanceof \Closure) ? call_user_func($default) : $default;
}
if (is_null($key)) return static::$items[$file];
......
......@@ -88,7 +88,7 @@ class Lang {
if ( ! $this->load($file))
{
return is_callable($default) ? call_user_func($default) : $default;
return ($default instanceof \Closure) ? call_user_func($default) : $default;
}
$line = Arr::get(static::$lines[$this->language.$file], $line, $default);
......
......@@ -83,7 +83,7 @@ class Handler {
{
if (isset($route->callback['do'])) return $route->callback['do'];
foreach ($route->callback as $value) { if (is_callable($value)) return $value; }
foreach ($route->callback as $value) { if ($value instanceof Closure) return $value; }
}
/**
......
......@@ -104,7 +104,7 @@ abstract class Driver {
if (array_key_exists($possibility, $this->session['data'])) return $this->session['data'][$possibility];
}
return is_callable($default) ? call_user_func($default) : $default;
return ($default instanceof \Closure) ? call_user_func($default) : $default;
}
/**
......
......@@ -91,7 +91,7 @@ class View implements Renderable {
{
foreach ((array) $composers[$this->view] as $key => $value)
{
if (is_callable($value)) return call_user_func($value, $this);
if ($value instanceof \Closure) return call_user_func($value, $this);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment