Test Setup Failed
Push — master ( 0807eb...463bbf )
by Tõnis
01:18
created
traits/MyActiveTrait.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         // if there is no user Id, we use the default ID 1
49 49
         if(!isset(Yii::$app->user) || empty(Yii::$app->user->identity)){
50 50
             $userId = 1;
51
-        }else{
51
+        } else{
52 52
             $userId = Yii::$app->user->identity->getId();
53 53
         }
54 54
         if ($this->isNewRecord){
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
                 self::updateClosingTime(parent::tableName());
116 116
                 $this->afterDelete();
117 117
                 return true;
118
-            }else {
118
+            } else {
119 119
                 throw new yii\base\UserException('Error deleting model');
120 120
             }
121 121
 
122
-        }else{
122
+        } else{
123 123
             // otherwise regular delete
124 124
             parent::delete();
125 125
             return true;
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                         $row[$key] = $value;
151 151
                     }
152 152
                     $rows[]=$row;
153
-                }  else {
153
+                } else {
154 154
                     throw new InvalidParamException('Missing object attributes in '. get_called_class().' '.__FUNCTION__);
155 155
                 }
156 156
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
             \Yii::$app->db->createCommand()->update(parent::tableName(), $baseParams,$conditions)->execute();
190 190
             self::updateClosingTime(static::tableName());
191 191
 
192
-        }else{
192
+        } else{
193 193
             throw new yii\base\InvalidArgumentException('No conditions defined for '. get_called_class().' '.__FUNCTION__);
194 194
         }
195 195
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         }
273 273
         if($newModel->save()){
274 274
             return $newModel;
275
-        }else{
275
+        } else{
276 276
             throw new yii\base\UserException('Error copying model');
277 277
         }
278 278
     }
Please login to merge, or discard this patch.
traits/ModelWithHasStatusTrait.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
                 $this->addStatus(StatusModel::STATUS_CREATED);
59 59
             }
60 60
             $this->addStatus($this->status);
61
-        }else{
61
+        } else{
62 62
             if(isset($changedAttributes['status'])){
63 63
                 $this->addStatus($this->status);
64 64
             }
Please login to merge, or discard this patch.
MyAssignment.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@
 block discarded – undo
127 127
 
128 128
                 if(!$this->childExists($childId)){
129 129
                     $model = new $this->assignmentClassname;
130
-                }else{
130
+                } else{
131 131
                     $model = $this->getCurrentChildById($childId);
132 132
                 }
133 133
 
Please login to merge, or discard this patch.
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.
myTemplates/crud/default/controller.php 1 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.