@@ -138,7 +138,7 @@ |
||
| 138 | 138 | private function whereInterval($interval): Expression |
| 139 | 139 | { |
| 140 | 140 | return new Expression('DATE_FORMAT(created_at, \'%Y-%m-%d %H\') > DATE_FORMAT(DATE_SUB(NOW(), INTERVAL :interval HOUR), \'%Y-%m-%d %H\')', [ |
| 141 | - 'interval' => (int)$interval, |
|
| 141 | + 'interval' => (int) $interval, |
|
| 142 | 142 | ]); |
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | \ No newline at end of file |
@@ -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'), |
@@ -150,7 +150,7 @@ |
||
| 150 | 150 | public function saveUsernames(array $usernames) |
| 151 | 151 | { |
| 152 | 152 | $createdAt = (new \DateTime())->format('Y-m-d H:i:s'); |
| 153 | - $rows = array_map(function ($username) use ($createdAt) { |
|
| 153 | + $rows = array_map(function($username) use ($createdAt) { |
|
| 154 | 154 | return [ |
| 155 | 155 | $username, |
| 156 | 156 | $createdAt, |
@@ -168,7 +168,7 @@ |
||
| 168 | 168 | [ |
| 169 | 169 | 'label' => $model->lastAccountStats->getAttributeLabel('er'), |
| 170 | 170 | 'yAxisID' => 'er', |
| 171 | - 'data' => array_map(function ($item) { |
|
| 171 | + 'data' => array_map(function($item) { |
|
| 172 | 172 | return number_format($item * 100, 2); |
| 173 | 173 | }, ArrayHelper::getColumn($dailyStatsData, 'er')), |
| 174 | 174 | 'fill' => false, |
@@ -168,7 +168,7 @@ |
||
| 168 | 168 | [ |
| 169 | 169 | 'label' => $model->lastAccountStats->getAttributeLabel('er'), |
| 170 | 170 | 'yAxisID' => 'er', |
| 171 | - 'data' => array_map(function ($item) { |
|
| 171 | + 'data' => array_map(function($item) { |
|
| 172 | 172 | return number_format($item * 100, 2); |
| 173 | 173 | }, ArrayHelper::getColumn($dailyStatsData, 'er')), |
| 174 | 174 | 'fill' => false, |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | BaseActiveRecord::EVENT_BEFORE_UPDATE => ['uid'], |
| 65 | 65 | ], |
| 66 | 66 | 'preserveNonEmptyValues' => true, |
| 67 | - 'value' => function () { |
|
| 67 | + 'value' => function() { |
|
| 68 | 68 | do { |
| 69 | 69 | $uid = Yii::$app->security->generateRandomString(64); |
| 70 | 70 | $uidExist = static::find() |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | [ |
| 35 | 35 | 'attribute' => 'username', |
| 36 | 36 | 'format' => 'raw', |
| 37 | - 'value' => function (Account $model, $key, $index, $column) { |
|
| 37 | + 'value' => function(Account $model, $key, $index, $column) { |
|
| 38 | 38 | if ($model->monitoring) { |
| 39 | 39 | $value = Html::a($model->usernamePrefixed, ['account/dashboard', 'id' => $model->id]); |
| 40 | 40 | } else { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | ], |
| 47 | 47 | [ |
| 48 | 48 | 'label' => 'Er', |
| 49 | - 'value' => function (Account $account) use ($formatter) { |
|
| 49 | + 'value' => function(Account $account) use ($formatter) { |
|
| 50 | 50 | if ($account->lastAccountStats) { |
| 51 | 51 | $er = $account->lastAccountStats->er; |
| 52 | 52 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | 'occurs', |
| 60 | 60 | [ |
| 61 | 61 | 'format' => 'raw', |
| 62 | - 'value' => function (Account $account) use ($model) { |
|
| 62 | + 'value' => function(Account $account) use ($model) { |
|
| 63 | 63 | return OnOffMonitoringButton::widget([ |
| 64 | 64 | 'model' => $account, |
| 65 | 65 | 'form' => new AccountMonitoringForm([ |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | BaseActiveRecord::EVENT_BEFORE_UPDATE => ['access_token'], |
| 37 | 37 | ], |
| 38 | 38 | 'preserveNonEmptyValues' => true, |
| 39 | - 'value' => function () { |
|
| 39 | + 'value' => function() { |
|
| 40 | 40 | do { |
| 41 | 41 | $token = Yii::$app->security->generateRandomString(64); |
| 42 | 42 | $tokenExist = static::find() |