@@ -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 | ], |
@@ -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 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | $color = array_shift($this->colors); |
71 | 71 | $data = ArrayHelper::getColumn($stats, $attribute); |
72 | 72 | if ($attribute == 'er') { |
73 | - $data = array_map(function ($item) { |
|
73 | + $data = array_map(function($item) { |
|
74 | 74 | return number_format($item * 100, 2); |
75 | 75 | }, $data); |
76 | 76 | } |
@@ -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([ |
@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | [ |
47 | 47 | 'attribute' => 'name', |
48 | - 'content' => function (\app\models\Tag $model) { |
|
48 | + 'content' => function(\app\models\Tag $model) { |
|
49 | 49 | $html = []; |
50 | 50 | $html[] = Html::a($model->namePrefixed, ['tag/stats', 'id' => $model->id]); |
51 | 51 | $html[] = Html::a('<span class="fa fa-external-link text-sm"></span>', Url::tag($model->name), ['target' => '_blank']); |
@@ -19,9 +19,9 @@ |
||
19 | 19 | <?php foreach ($authAuthChoice->getClients() as $client): ?> |
20 | 20 | <div class="form-group text-center"> |
21 | 21 | <?php if ($client->getId() == 'google'): ?> |
22 | - <?= Html::a(Html::img('/img/btn_google_signin.png'), ['/admin/auth/auth', 'authclient' => $client->getName(),]) ?> |
|
22 | + <?= Html::a(Html::img('/img/btn_google_signin.png'), ['/admin/auth/auth', 'authclient' => $client->getName(), ]) ?> |
|
23 | 23 | <?php else: ?> |
24 | - <?= Html::a("<span class='fa fa-$client->name'></span> Sign in with " . $client->getTitle(), ['/admin/auth/auth', 'authclient' => $client->getName(),], ['class' => "btn btn-block btn-social btn-$client->name "]) ?> |
|
24 | + <?= Html::a("<span class='fa fa-$client->name'></span> Sign in with " . $client->getTitle(), ['/admin/auth/auth', 'authclient' => $client->getName(), ], ['class' => "btn btn-block btn-social btn-$client->name "]) ?> |
|
25 | 25 | <?php endif; ?> |
26 | 26 | </div> |
27 | 27 | <?php endforeach; ?> |
@@ -20,9 +20,12 @@ |
||
20 | 20 | <div class="form-group text-center"> |
21 | 21 | <?php if ($client->getId() == 'google'): ?> |
22 | 22 | <?= Html::a(Html::img('/img/btn_google_signin.png'), ['/admin/auth/auth', 'authclient' => $client->getName(),]) ?> |
23 | - <?php else: ?> |
|
23 | + <?php else { |
|
24 | + : ?> |
|
24 | 25 | <?= Html::a("<span class='fa fa-$client->name'></span> Sign in with " . $client->getTitle(), ['/admin/auth/auth', 'authclient' => $client->getName(),], ['class' => "btn btn-block btn-social btn-$client->name "]) ?> |
25 | - <?php endif; ?> |
|
26 | + <?php endif; |
|
27 | +} |
|
28 | +?> |
|
26 | 29 | </div> |
27 | 30 | <?php endforeach; ?> |
28 | 31 | <?php AuthChoice::end() ?> |
29 | 32 | \ No newline at end of file |
@@ -70,11 +70,11 @@ |
||
70 | 70 | 'class' => 'yii\gii\Module', |
71 | 71 | ]; |
72 | 72 | $config['modules']['fixture'] = [ // Fixture generation command line. |
73 | - 'class' => \yii\faker\FixtureController::class, |
|
74 | - 'templatePath' => 'tests/fixtures/templates', |
|
75 | - 'fixtureDataPath' => 'tests/fixtures/data', |
|
76 | - 'namespace' => 'app\tests\fixtures', |
|
77 | - 'count' => 10, |
|
73 | + 'class' => \yii\faker\FixtureController::class, |
|
74 | + 'templatePath' => 'tests/fixtures/templates', |
|
75 | + 'fixtureDataPath' => 'tests/fixtures/data', |
|
76 | + 'namespace' => 'app\tests\fixtures', |
|
77 | + 'count' => 10, |
|
78 | 78 | ]; |
79 | 79 | } |
80 | 80 |
@@ -69,7 +69,7 @@ |
||
69 | 69 | $config['modules']['gii'] = [ |
70 | 70 | 'class' => 'yii\gii\Module', |
71 | 71 | ]; |
72 | - $config['modules']['fixture'] = [ // Fixture generation command line. |
|
72 | + $config['modules']['fixture'] = [// Fixture generation command line. |
|
73 | 73 | 'class' => \yii\faker\FixtureController::class, |
74 | 74 | 'templatePath' => 'tests/fixtures/templates', |
75 | 75 | 'fixtureDataPath' => 'tests/fixtures/data', |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require __DIR__.'/../config/env.php'; |
|
3 | +require __DIR__ . '/../config/env.php'; |
|
4 | 4 | |
5 | 5 | require __DIR__ . '/../vendor/autoload.php'; |
6 | 6 | require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php'; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $accounts = $accounts instanceof Account ? [$accounts->id] : ArrayHelper::getColumn($accounts, 'id'); |
44 | 44 | |
45 | 45 | $q = Category::find() |
46 | - ->innerJoin('account_category ac', 'category.id=ac.category_id AND ac.user_id=' . (int)$user->id) |
|
46 | + ->innerJoin('account_category ac', 'category.id=ac.category_id AND ac.user_id=' . (int) $user->id) |
|
47 | 47 | ->andFilterWhere(['ac.account_id' => $accounts]); |
48 | 48 | |
49 | 49 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $tags = $tags instanceof Tag ? [$tags->id] : ArrayHelper::getColumn($tags, 'id'); |
62 | 62 | |
63 | 63 | $q = Category::find() |
64 | - ->innerJoin('tag_category ac', 'category.id=ac.category_id AND ac.user_id=' . (int)$user->id) |
|
64 | + ->innerJoin('tag_category ac', 'category.id=ac.category_id AND ac.user_id=' . (int) $user->id) |
|
65 | 65 | ->andFilterWhere(['ac.tag_id' => $tags]); |
66 | 66 | |
67 | 67 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | public function addToAccount(Account $account, array $categories, User $user) |
101 | 101 | { |
102 | 102 | $this->saveCategories($categories); |
103 | - $rows = array_map(function ($categoryId) use ($account, $user) { |
|
103 | + $rows = array_map(function($categoryId) use ($account, $user) { |
|
104 | 104 | return [ |
105 | 105 | $account->id, |
106 | 106 | $categoryId, |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | public function saveCategories(array $categories) |
161 | 161 | { |
162 | - $rows = array_map(function ($category) { |
|
162 | + $rows = array_map(function($category) { |
|
163 | 163 | return [$category]; |
164 | 164 | }, $categories); |
165 | 165 |