diff --git a/src/ActiveRecord.php b/src/ActiveRecord.php index d29f50e..7b996c0 100644 --- a/src/ActiveRecord.php +++ b/src/ActiveRecord.php @@ -11,6 +11,7 @@ namespace hiqdev\hiart; +use Yii; use yii\base\InvalidConfigException; use yii\base\NotSupportedException; use yii\db\ActiveQueryInterface; @@ -30,7 +31,7 @@ class ActiveRecord extends BaseActiveRecord */ public static function getDb() { - return \Yii::$app->get('hiart'); + return Yii::$app->get('hiart'); } /** @@ -41,10 +42,10 @@ public static function getDb() public static function find($options = []) { $config = [ - 'class' => ActiveQuery::className(), + 'class' => ActiveQuery::class, 'options' => $options, ]; - return \Yii::createObject($config, [get_called_class()]); + return Yii::createObject($config, [get_called_class()]); } /** diff --git a/src/DebugAction.php b/src/DebugAction.php index 4dcb4fa..1bbac74 100644 --- a/src/DebugAction.php +++ b/src/DebugAction.php @@ -59,7 +59,7 @@ public function run($logId, $tag) parse_str($body, $options); /* @var $db Connection */ - $db = \Yii::$app->get($this->db); + $db = Yii::$app->get($this->db); $time = microtime(true); switch ($method) { case 'GET': diff --git a/src/DebugPanel.php b/src/DebugPanel.php index 747fa24..b1e1a64 100644 --- a/src/DebugPanel.php +++ b/src/DebugPanel.php @@ -11,6 +11,7 @@ namespace hiqdev\hiart; +use Yii; use yii\debug\Panel; use yii\helpers\ArrayHelper; use yii\helpers\Html; @@ -81,7 +82,7 @@ public function getDetail() $i = 0; // Try to get API URL try { - $component = \Yii::$app->get('hiart'); + $component = Yii::$app->get('hiart'); $apiUrl = (StringHelper::endsWith($component->config['base_uri'], '/')) ? $component->config['base_uri'] : $component->config['base_uri'] . '/'; } catch (\yii\base\InvalidConfigException $e) { @@ -135,7 +136,7 @@ public function getDetail() } $rows = implode("\n", $rows); - \Yii::$app->view->registerCss(<<view->registerCss(<<view->registerJs(<<view->registerJs(<</g, '>'); return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {