Passed
Branch master (b38eac)
by Tõnis
03:12
created
src/Setting.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
      * @param $key string
46 46
      * @return static
47 47
      */
48
-    public function findOneByKey($key){
48
+    public function findOneByKey($key) {
49 49
         /** @var static $model */
50 50
         $model = static::find()
51 51
             ->andWhere([$this->keyColumn => $key])
Please login to merge, or discard this patch.
src/myTemplates/crud/default/views/index.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,8 @@  discard block
 block discarded – undo
69 69
                 ['class' => 'yii\grid\ActionColumn'],
70 70
                 ],
71 71
                 ]); ?>
72
-            <?php else: ?>
72
+            <?php else {
73
+    : ?>
73 74
                 <?= "<?= " ?>ListView::widget([
74 75
                 'dataProvider' => $dataProvider,
75 76
                 'itemOptions' => ['class' => 'item'],
@@ -77,7 +78,9 @@  discard block
 block discarded – undo
77 78
                 return Html::a(Html::encode($model-><?= $nameAttribute ?>), ['view', <?= $urlParams ?>]);
78 79
                 },
79 80
                 ]) ?>
80
-            <?php endif; ?>
81
+            <?php endif;
82
+}
83
+?>
81 84
 
82 85
         </div>
83 86
     </div>
Please login to merge, or discard this patch.
src/myTemplates/crud/default/controller.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 use <?= ltrim($generator->modelClass, '\\') ?>;
34 34
 <?php if (!empty($generator->searchModelClass)): ?>
35 35
 use <?= ltrim($generator->searchModelClass, '\\') . (isset($searchModelAlias) ? " as $searchModelAlias" : "") ?>;
36
-<?php else: ?>
36
+<?php else : ?>
37 37
 use yii\data\ActiveDataProvider;
38
-<?php endif;?>
38
+<?php endif; ?>
39 39
 use <?= ltrim($generator->baseControllerClass, '\\') ?>;
40 40
 use yii\web\NotFoundHttpException;
41 41
 use yii\web\ForbiddenHttpException;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             'searchModel' => $searchModel,
98 98
             'dataProvider' => $dataProvider,
99 99
         ]);
100
-<?php else: ?>
100
+<?php else : ?>
101 101
         $dataProvider = new ActiveDataProvider([
102 102
             'query' => <?= $modelClass ?>::find(),
103 103
         ]);
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         return $this->render('index', [
106 106
             'dataProvider' => $dataProvider,
107 107
         ]);
108
-<?php endif;?>
108
+<?php endif; ?>
109 109
     }
110 110
 
111 111
     /**
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,9 +33,12 @@  discard block
 block discarded – undo
33 33
 use <?= ltrim($generator->modelClass, '\\') ?>;
34 34
 <?php if (!empty($generator->searchModelClass)): ?>
35 35
 use <?= ltrim($generator->searchModelClass, '\\') . (isset($searchModelAlias) ? " as $searchModelAlias" : "") ?>;
36
-<?php else: ?>
36
+<?php else {
37
+    : ?>
37 38
 use yii\data\ActiveDataProvider;
38
-<?php endif;?>
39
+<?php endif;
40
+}
41
+?>
39 42
 use <?= ltrim($generator->baseControllerClass, '\\') ?>;
40 43
 use yii\web\NotFoundHttpException;
41 44
 use yii\web\ForbiddenHttpException;
@@ -97,7 +100,8 @@  discard block
 block discarded – undo
97 100
             'searchModel' => $searchModel,
98 101
             'dataProvider' => $dataProvider,
99 102
         ]);
100
-<?php else: ?>
103
+<?php else {
104
+    : ?>
101 105
         $dataProvider = new ActiveDataProvider([
102 106
             'query' => <?= $modelClass ?>::find(),
103 107
         ]);
@@ -105,7 +109,9 @@  discard block
 block discarded – undo
105 109
         return $this->render('index', [
106 110
             'dataProvider' => $dataProvider,
107 111
         ]);
108
-<?php endif;?>
112
+<?php endif;
113
+}
114
+?>
109 115
     }
110 116
 
111 117
     /**
Please login to merge, or discard this patch.
src/Settings.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
                     /** @var Setting $setting */
61 61
                     $setting = new $this->itemClass;
62 62
 
63
-                    if (! $setting->findOneByKey($checkAttribute)) {
63
+                    if (!$setting->findOneByKey($checkAttribute)) {
64 64
                         throw new yii\base\InvalidConfigException('Key "' . $checkAttribute . '" is missing in ' . $this->itemClass);
65 65
                     }
66 66
                 }
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 
44 44
         $this->setSettings();
45 45
         if (!is_null($this->typeClass)) {
46
-           $this->loadStrings();
46
+            $this->loadStrings();
47 47
         }
48 48
     }
49 49
 
Please login to merge, or discard this patch.
src/test/ModelTestTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     public function testRulesForExistingAttributesOnly() {
29 29
         // labels only for actually existing attributes
30 30
         foreach ($this->model->rules() as $rule) {
31
-            $rules = (is_array($rule[0]) ? $rule[0] : [$rule[0]] );
31
+            $rules = (is_array($rule[0]) ? $rule[0] : [$rule[0]]);
32 32
             foreach ($rules as $attribute) {
33 33
                 $this->assertArrayHasKey($attribute, array_merge(get_object_vars($this->model), $this->model->attributes));
34 34
             }
Please login to merge, or discard this patch.
src/myTemplates/crud/admin/controller.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@
 block discarded – undo
32 32
 use <?= ltrim($generator->modelClass, '\\') ?>;
33 33
 <?php if (!empty($generator->searchModelClass)): ?>
34 34
 use <?= ltrim($generator->searchModelClass, '\\') . (isset($searchModelAlias) ? " as $searchModelAlias" : "") ?>;
35
-<?php else: ?>
35
+<?php else : ?>
36 36
 use yii\data\ActiveDataProvider;
37
-<?php endif;?>
37
+<?php endif; ?>
38 38
 use <?= ltrim($generator->baseControllerClass, '\\') ?>;
39 39
 
40 40
 /**
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,9 +32,12 @@
 block discarded – undo
32 32
 use <?= ltrim($generator->modelClass, '\\') ?>;
33 33
 <?php if (!empty($generator->searchModelClass)): ?>
34 34
 use <?= ltrim($generator->searchModelClass, '\\') . (isset($searchModelAlias) ? " as $searchModelAlias" : "") ?>;
35
-<?php else: ?>
35
+<?php else {
36
+    : ?>
36 37
 use yii\data\ActiveDataProvider;
37
-<?php endif;?>
38
+<?php endif;
39
+}
40
+?>
38 41
 use <?= ltrim($generator->baseControllerClass, '\\') ?>;
39 42
 
40 43
 /**
Please login to merge, or discard this patch.
src/myTemplates/crud/admin/views/index.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,8 @@  discard block
 block discarded – undo
69 69
                 ['class' => 'yii\grid\ActionColumn'],
70 70
                 ],
71 71
                 ]); ?>
72
-            <?php else: ?>
72
+            <?php else {
73
+    : ?>
73 74
                 <?= "<?= " ?>ListView::widget([
74 75
                 'dataProvider' => $dataProvider,
75 76
                 'itemOptions' => ['class' => 'item'],
@@ -77,7 +78,9 @@  discard block
 block discarded – undo
77 78
                 return Html::a(Html::encode($model-><?= $nameAttribute ?>), ['view', <?= $urlParams ?>]);
78 79
                 },
79 80
                 ]) ?>
80
-            <?php endif; ?>
81
+            <?php endif;
82
+}
83
+?>
81 84
 
82 85
         </div>
83 86
     </div>
Please login to merge, or discard this patch.
src/traits/MyActiveTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
      */
314 314
     private function lastClosingTime($tableName) {
315 315
         $cacheKey = "closing:time:{$tableName}";
316
-        return Yii::$app->cache->getOrSet($cacheKey, function () use ($tableName) {
316
+        return Yii::$app->cache->getOrSet($cacheKey, function() use ($tableName) {
317 317
             $dateHelper = new DateHelper();
318 318
 
319 319
             if (!$this->hasClosing($tableName)) {
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
     private function hasClosing($tableName)
336 336
     {
337 337
         $cacheKey = "closing:has:{$tableName}";
338
-        return Yii::$app->cache->getOrSet($cacheKey, function () use ($tableName) {
338
+        return Yii::$app->cache->getOrSet($cacheKey, function() use ($tableName) {
339 339
             $closing = Closing::findOne($tableName);
340 340
             return !($closing == null);
341 341
         });
Please login to merge, or discard this patch.
src/traits/ConsoleAwareTrait.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,6 @@
 block discarded – undo
7 7
 /**
8 8
  * Class ConsoleAwareTrait
9 9
  * @package andmemasin\myabstract\traits
10
-
11 10
  * @property boolean $isConsole whether we currently run in console app or not
12 11
  *
13 12
  */
Please login to merge, or discard this patch.