mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-18 23:43:19 +08:00
Remove use ($this). Related to 9e1b498fb5.
This commit is contained in:
@@ -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 '<a href="http://yiiframework.com/doc/api/2.0/' . $this->htmlEncode($matches[1]) . '" target="_blank">' .
|
||||
$this->htmlEncode($matches[1]) . '</a>()';
|
||||
}, $code);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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'));
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user