@@ -3,7 +3,7 @@ |
||
| 3 | 3 | return [ |
| 4 | 4 | 'definitions' => [ |
| 5 | 5 | \yii\behaviors\TimestampBehavior::class => [ |
| 6 | - 'value' => function () { |
|
| 6 | + 'value' => function() { |
|
| 7 | 7 | return (new DateTime('now', new DateTimeZone('UTC')))->format('Y-m-d H:i:s'); |
| 8 | 8 | }, |
| 9 | 9 | ], |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | 'tag.*', |
| 123 | 123 | 'count(tag.id) as occurs', |
| 124 | 124 | ]) |
| 125 | - ->innerJoinWith(['media' => function (Query $q) use ($model) { |
|
| 125 | + ->innerJoinWith(['media' => function(Query $q) use ($model) { |
|
| 126 | 126 | $q->andWhere(['media.account_id' => $model->id]); |
| 127 | 127 | }]) |
| 128 | 128 | ->groupBy('tag.id'), |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | 'account.*', |
| 155 | 155 | 'count(account.id) as occurs', |
| 156 | 156 | ]) |
| 157 | - ->innerJoinWith(['mediaAccounts.media' => function (Query $q) use ($model) { |
|
| 157 | + ->innerJoinWith(['mediaAccounts.media' => function(Query $q) use ($model) { |
|
| 158 | 158 | $q->andWhere(['media.account_id' => $model->id]); |
| 159 | 159 | }]) |
| 160 | 160 | ->groupBy('account.id'), |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | { |
| 67 | 67 | static::$proxies = static::$proxies ?? Proxy::find()->joinWith('tags')->active()->all(); |
| 68 | 68 | |
| 69 | - return ArrayHelper::map(static::$proxies, 'id', function (Proxy $model) { |
|
| 69 | + return ArrayHelper::map(static::$proxies, 'id', function(Proxy $model) { |
|
| 70 | 70 | $tags = ArrayHelper::getColumn($model->tags, 'name'); |
| 71 | 71 | |
| 72 | 72 | return $model->ip . ($tags ? ' # ' . implode(',', $tags) : ''); |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | 'yii\queue\db\migrations', |
| 63 | 63 | ], |
| 64 | 64 | ], |
| 65 | - 'fixture' => [ // Fixture generation command line. |
|
| 65 | + 'fixture' => [// Fixture generation command line. |
|
| 66 | 66 | 'class' => \yii\faker\FixtureController::class, |
| 67 | 67 | 'templatePath' => 'tests/fixtures/templates', |
| 68 | 68 | 'fixtureDataPath' => 'tests/fixtures/data', |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$webConfig = require __DIR__.'/web.php'; |
|
| 3 | +$webConfig = require __DIR__ . '/web.php'; |
|
| 4 | 4 | |
| 5 | 5 | $db = require __DIR__ . '/test_db.php'; |
| 6 | 6 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | public function init() |
| 48 | 48 | { |
| 49 | 49 | parent::init(); |
| 50 | - $userId = (int)\Yii::$app->user->id; |
|
| 50 | + $userId = (int) \Yii::$app->user->id; |
|
| 51 | 51 | $this->modelTags = $this->getTags($userId, $this->model->id); |
| 52 | 52 | $this->allTags = $this->getTags($userId); |
| 53 | 53 | $this->formAction = $this->formAction ?: ['tags', 'id' => $this->model->id]; |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | */ |
| 46 | 46 | public function search($params) |
| 47 | 47 | { |
| 48 | - $userId = (int)\Yii::$app->user->id; |
|
| 48 | + $userId = (int) \Yii::$app->user->id; |
|
| 49 | 49 | |
| 50 | 50 | $query = Account::find() |
| 51 | 51 | ->select([ |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | [ |
| 34 | 34 | 'attribute' => 'username', |
| 35 | 35 | 'format' => 'raw', |
| 36 | - 'value' => function (Account $model, $key, $index, $column) { |
|
| 36 | + 'value' => function(Account $model, $key, $index, $column) { |
|
| 37 | 37 | if ($model->monitoring) { |
| 38 | 38 | $value = Html::a($model->usernamePrefixed, ['account/dashboard', 'id' => $model->id]); |
| 39 | 39 | } else { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | ], |
| 46 | 46 | [ |
| 47 | 47 | 'label' => (new \app\models\AccountStats())->getAttributeLabel('er'), |
| 48 | - 'value' => function (Account $account) use ($formatter) { |
|
| 48 | + 'value' => function(Account $account) use ($formatter) { |
|
| 49 | 49 | if ($account->monitoring && $account->lastAccountStats) { |
| 50 | 50 | $er = $account->lastAccountStats->er; |
| 51 | 51 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | 'occurs', |
| 59 | 59 | [ |
| 60 | 60 | 'format' => 'raw', |
| 61 | - 'value' => function (Account $account) use ($model) { |
|
| 61 | + 'value' => function(Account $account) use ($model) { |
|
| 62 | 62 | return OnOffMonitoringButton::widget([ |
| 63 | 63 | 'model' => $account, |
| 64 | 64 | 'form' => new MonitoringForm([ |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | ['class' => \yii\grid\SerialColumn::class], |
| 33 | 33 | [ |
| 34 | 34 | 'attribute' => 'username', |
| 35 | - 'content' => function (\app\models\Account $model) { |
|
| 35 | + 'content' => function(\app\models\Account $model) { |
|
| 36 | 36 | $html = []; |
| 37 | 37 | $html[] = Html::a($model->displayName, ['account/dashboard', 'id' => $model->id]); |
| 38 | 38 | $html[] = Html::a('<span class="fa fa-external-link text-sm"></span>', Url::account($model->username), ['target' => '_blank']); |