@@ -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 | ], |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | if ($account->save()) { |
| 54 | 54 | \Yii::$app->session->setFlash('success', 'OK!'); |
| 55 | 55 | $accountManager = \Yii::createObject(AccountManager::class); |
| 56 | - $accountManager->updateTags($account, (array)$form->tags); |
|
| 56 | + $accountManager->updateTags($account, (array) $form->tags); |
|
| 57 | 57 | } else { |
| 58 | 58 | \Yii::error('Validation error: ' . json_encode($account->errors), __METHOD__); |
| 59 | 59 | \Yii::$app->session->setFlash('error', 'ERR!'); |
@@ -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, |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | ['class' => \yii\grid\SerialColumn::class], |
| 31 | 31 | [ |
| 32 | 32 | 'attribute' => 'username', |
| 33 | - 'content' => function (\app\models\Account $model) { |
|
| 33 | + 'content' => function(\app\models\Account $model) { |
|
| 34 | 34 | $html = []; |
| 35 | 35 | if ($model->disabled) { |
| 36 | 36 | $html[] = '<span class="fa fa-exclamation-triangle text-danger" title="Not found."></span>'; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | ], |
| 65 | 65 | [ |
| 66 | 66 | 'attribute' => 's_tags', |
| 67 | - 'value' => function (Account $model) { |
|
| 67 | + 'value' => function(Account $model) { |
|
| 68 | 68 | $tags = $model->getTags()->select('tag.name')->column(); |
| 69 | 69 | if ($tags) { |
| 70 | 70 | return implode(', ', $tags); |
@@ -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([ |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | BaseActiveRecord::EVENT_BEFORE_UPDATE => ['uid'], |
| 66 | 66 | ], |
| 67 | 67 | 'preserveNonEmptyValues' => true, |
| 68 | - 'value' => function () { |
|
| 68 | + 'value' => function() { |
|
| 69 | 69 | do { |
| 70 | 70 | $uid = Yii::$app->security->generateRandomString(64); |
| 71 | 71 | $uidExist = static::find() |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | [['updated_at', 'created_at'], 'safe'], |
| 108 | 108 | [['proxy_id', 'proxy_tag_id', 'occurs'], 'integer'], |
| 109 | 109 | [['name', 'username', 'profile_pic_url', 'full_name', 'biography', 'external_url', 'instagram_id', 'notes', 'uid'], 'string', 'max' => 255], |
| 110 | - [['monitoring','disabled'], 'boolean'], |
|
| 110 | + [['monitoring', 'disabled'], 'boolean'], |
|
| 111 | 111 | [['username'], 'unique'], |
| 112 | 112 | [['proxy_id'], 'exist', 'skipOnError' => true, 'targetClass' => Proxy::class, 'targetAttribute' => ['proxy_id' => 'id']], |
| 113 | 113 | [['proxy_tag_id'], 'exist', 'skipOnError' => true, 'targetClass' => Tag::class, 'targetAttribute' => ['proxy_tag_id' => 'id']], |