Commit d0ddb566 by Alexander Makarov

Fixes #699: fixed wrong usage of self and static

parent 4ccf0931
......@@ -54,7 +54,7 @@ class Widget extends Component implements ViewContextInterface
$config['class'] = get_called_class();
/** @var Widget $widget */
$widget = Yii::createObject($config);
self::$stack[] = $widget;
static::$stack[] = $widget;
return $widget;
}
......@@ -67,8 +67,8 @@ class Widget extends Component implements ViewContextInterface
*/
public static function end()
{
if (!empty(self::$stack)) {
$widget = array_pop(self::$stack);
if (!empty(static::$stack)) {
$widget = array_pop(static::$stack);
if (get_class($widget) === get_called_class()) {
echo $widget->run();
return $widget;
......@@ -108,7 +108,7 @@ class Widget extends Component implements ViewContextInterface
public function getId($autoGenerate = true)
{
if ($autoGenerate && $this->_id === null) {
$this->_id = self::$autoIdPrefix . self::$counter++;
$this->_id = static::$autoIdPrefix . static::$counter++;
}
return $this->_id;
......
......@@ -98,9 +98,9 @@ class GettextMessageSource extends MessageSource
{
$messageFile = Yii::getAlias($this->basePath) . '/' . $language . '/' . $this->catalog;
if ($this->useMoFile) {
$messageFile .= static::MO_FILE_EXT;
$messageFile .= self::MO_FILE_EXT;
} else {
$messageFile .= static::PO_FILE_EXT;
$messageFile .= self::PO_FILE_EXT;
}
return $messageFile;
......
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