From b3b5e36d42a1187c14acfa371cf237529a8cddc0 Mon Sep 17 00:00:00 2001 From: resurtm Date: Fri, 18 Oct 2013 09:46:52 +0600 Subject: [PATCH] Remove use ($this). Related to 9e1b498fb513b3c51c6f943180a317ffef6f05e2. --- framework/yii/base/ErrorHandler.php | 2 +- framework/yii/db/Connection.php | 2 +- framework/yii/debug/Module.php | 2 +- framework/yii/widgets/BaseListView.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/yii/base/ErrorHandler.php b/framework/yii/base/ErrorHandler.php index 37e4a85..dec5779 100644 --- a/framework/yii/base/ErrorHandler.php +++ b/framework/yii/base/ErrorHandler.php @@ -175,7 +175,7 @@ class ErrorHandler extends Component $html = rtrim($html, '\\'); } elseif (strpos($code, '()') !== false) { // method/function call - $html = preg_replace_callback('/^(.*)\(\)$/', function ($matches) use ($this) { + $html = preg_replace_callback('/^(.*)\(\)$/', function ($matches) { return '' . $this->htmlEncode($matches[1]) . '()'; }, $code); diff --git a/framework/yii/db/Connection.php b/framework/yii/db/Connection.php index d3058cf..b79146d 100644 --- a/framework/yii/db/Connection.php +++ b/framework/yii/db/Connection.php @@ -509,7 +509,7 @@ class Connection extends Component public function quoteSql($sql) { return preg_replace_callback('/(\\{\\{(%?[\w\-\. ]+%?)\\}\\}|\\[\\[([\w\-\. ]+)\\]\\])/', - function ($matches) use ($this) { + function ($matches) { if (isset($matches[3])) { return $this->quoteColumnName($matches[3]); } else { diff --git a/framework/yii/debug/Module.php b/framework/yii/debug/Module.php index a9929c4..260a981 100644 --- a/framework/yii/debug/Module.php +++ b/framework/yii/debug/Module.php @@ -57,7 +57,7 @@ class Module extends \yii\base\Module $this->dataPath = Yii::getAlias($this->dataPath); $this->logTarget = Yii::$app->getLog()->targets['debug'] = new LogTarget($this); // do not initialize view component before application is ready (needed when debug in preload) - Yii::$app->on(Application::EVENT_BEFORE_ACTION, function() use ($this) { + Yii::$app->on(Application::EVENT_BEFORE_ACTION, function() { Yii::$app->getView()->on(View::EVENT_END_BODY, array($this, 'renderToolbar')); }); diff --git a/framework/yii/widgets/BaseListView.php b/framework/yii/widgets/BaseListView.php index e292f38..d59c197 100644 --- a/framework/yii/widgets/BaseListView.php +++ b/framework/yii/widgets/BaseListView.php @@ -92,7 +92,7 @@ abstract class BaseListView extends Widget public function run() { if ($this->dataProvider->getCount() > 0 || $this->empty === false) { - $content = preg_replace_callback("/{\\w+}/", function ($matches) use ($this) { + $content = preg_replace_callback("/{\\w+}/", function ($matches) { $content = $this->renderSection($matches[0]); return $content === false ? $matches[0] : $content; }, $this->layout);