@@ -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), |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | return $this->fetchContent($url, $account); |
81 | 81 | } |
82 | 82 | |
83 | - return $this->cache->getOrSet([$url], function ($cache) use ($url, $account) { |
|
83 | + return $this->cache->getOrSet([$url], function($cache) use ($url, $account) { |
|
84 | 84 | return $this->fetchContent($url, $account); |
85 | 85 | }, 3600); |
86 | 86 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | public function saveUsernames(array $usernames) |
159 | 159 | { |
160 | 160 | $createdAt = (new \DateTime())->format('Y-m-d H:i:s'); |
161 | - $rows = array_map(function ($username) use ($createdAt) { |
|
161 | + $rows = array_map(function($username) use ($createdAt) { |
|
162 | 162 | return [ |
163 | 163 | $username, |
164 | 164 | $createdAt, |
@@ -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 | ], |