From b3460fc30e73300194dea8399a38347a71e21ce1 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Fri, 18 May 2012 12:32:11 -0400 Subject: [PATCH] ... --- framework/db/ar/ActiveFinder.php | 2 +- framework/db/ar/ActiveRecord.php | 2 +- framework/util/ArrayHelper.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/db/ar/ActiveFinder.php b/framework/db/ar/ActiveFinder.php index f584932..b5b085e 100644 --- a/framework/db/ar/ActiveFinder.php +++ b/framework/db/ar/ActiveFinder.php @@ -300,7 +300,7 @@ class ActiveFinder extends \yii\base\Object } if ($config instanceof \Closure) { - call_user_func($config, $child->query); + $config($child->query); } else { foreach ($config as $name => $value) { $child->query->$name = $value; diff --git a/framework/db/ar/ActiveRecord.php b/framework/db/ar/ActiveRecord.php index 35fd221..bdd8756 100644 --- a/framework/db/ar/ActiveRecord.php +++ b/framework/db/ar/ActiveRecord.php @@ -574,7 +574,7 @@ abstract class ActiveRecord extends Model } $relation = clone $relation; if ($params instanceof \Closure) { - call_user_func($params, $relation); + $params($relation); } else { foreach ($params as $name => $value) { $relation->$name = $value; diff --git a/framework/util/ArrayHelper.php b/framework/util/ArrayHelper.php index 6b73fd2..c70f03a 100644 --- a/framework/util/ArrayHelper.php +++ b/framework/util/ArrayHelper.php @@ -77,7 +77,7 @@ class ArrayHelper public static function get($array, $key, $default = null) { if ($key instanceof \Closure) { - return call_user_func($key, $array, $default); + return $key($array, $default); } elseif (is_array($array)) { return isset($array[$key]) || array_key_exists($key, $array) ? $array[$key] : $default; } else {