@@ -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 |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | /** @var \yii\caching\Cache $cache */ |
| 26 | 26 | $cache = Instance::ensure($this->cache); |
| 27 | 27 | |
| 28 | - $items = $cache->getOrSet(__METHOD__, function (Cache $cache) { |
|
| 28 | + $items = $cache->getOrSet(__METHOD__, function(Cache $cache) { |
|
| 29 | 29 | return (new \jakim\ua\UserAgent())->fetch(); |
| 30 | 30 | }, 60 * 60 * 24 * 30); |
| 31 | 31 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | return $this->fetchContent($url, $tag); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return $this->cache->getOrSet([$url], function () use ($url, $tag) { |
|
| 56 | + return $this->cache->getOrSet([$url], function() use ($url, $tag) { |
|
| 57 | 57 | return $this->fetchContent($url, $tag); |
| 58 | 58 | }, 3600); |
| 59 | 59 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | public function saveTags(array $tags) |
| 121 | 121 | { |
| 122 | 122 | $createdAt = (new \DateTime())->format('Y-m-d H:i:s'); |
| 123 | - $rows = array_map(function ($tag) use ($createdAt) { |
|
| 123 | + $rows = array_map(function($tag) use ($createdAt) { |
|
| 124 | 124 | return [ |
| 125 | 125 | $tag, |
| 126 | 126 | Inflector::slug($tag), |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | 'class' => 'yii\gii\Module', |
| 82 | 82 | // uncomment the following to add your IP if you are not connecting from localhost. |
| 83 | 83 | //'allowedIPs' => ['127.0.0.1', '::1'], |
| 84 | - 'generators' => [ //here |
|
| 84 | + 'generators' => [//here |
|
| 85 | 85 | 'crud' => [ |
| 86 | 86 | 'class' => 'yii\gii\generators\crud\Generator', |
| 87 | 87 | 'templates' => [ |
@@ -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'), |
@@ -166,7 +166,7 @@ |
||
| 166 | 166 | [ |
| 167 | 167 | 'label' => $model->lastAccountStats->getAttributeLabel('er'), |
| 168 | 168 | 'yAxisID' => 'er', |
| 169 | - 'data' => array_map(function ($item) { |
|
| 169 | + 'data' => array_map(function($item) { |
|
| 170 | 170 | return number_format($item * 100, 2); |
| 171 | 171 | }, ArrayHelper::getColumn($monthAccountStats, 'er')), |
| 172 | 172 | 'fill' => false, |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | [ |
| 28 | 28 | 'attribute' => 'name', |
| 29 | - 'content' => function (\app\models\Tag $model) { |
|
| 29 | + 'content' => function(\app\models\Tag $model) { |
|
| 30 | 30 | return Html::a($model->namePrefixed, ['tag/stats', 'id' => $model->id]); |
| 31 | 31 | }, |
| 32 | 32 | ], |
@@ -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 | return Html::a($model->usernamePrefixed, ['account/dashboard', 'id' => $model->id]) . ' ' |
| 35 | 35 | . Html::a('<span class="fa fa-external-link text-sm"></span>', Url::account($model->username), ['target' => '_blank']); |
| 36 | 36 | }, |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | ], |
| 59 | 59 | [ |
| 60 | 60 | 'attribute' => 's_tags', |
| 61 | - 'value' => function (Account $model) { |
|
| 61 | + 'value' => function(Account $model) { |
|
| 62 | 62 | $tags = $model->getTags()->select('tag.name')->column(); |
| 63 | 63 | if ($tags) { |
| 64 | 64 | return implode(', ', $tags); |