Completed
Push — master ( 9c1cd5...e7beb0 )
by Tõnis
03:00
created
src/traits/MyActiveTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -299,7 +299,7 @@
 block discarded – undo
299 299
      * @param string $tableName
300 300
      * @return bool
301 301
      */
302
-    private static function hasClosing($tableName){
302
+    private static function hasClosing($tableName) {
303 303
             $closing = Closing::findOne($tableName);
304 304
             return !($closing == null);
305 305
     }
Please login to merge, or discard this patch.
src/myTemplates/crud/default/views/index.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
                 return Html::a(Html::encode($model-><?= $nameAttribute ?>), ['view', <?= $urlParams ?>]);
78 78
                 },
79 79
                 ]) ?>
80
-            <?php endif;?>
80
+            <?php endif; ?>
81 81
 
82 82
         </div>
83 83
     </div>
Please login to merge, or discard this 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 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.
src/Settings.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -95,15 +95,15 @@  discard block
 block discarded – undo
95 95
 
96 96
 
97 97
     /** {@inheritdoc} */
98
-    public function setSettings(){
98
+    public function setSettings() {
99 99
         // get existing settings
100 100
 
101 101
         /** @var Setting $settingClass */
102 102
         $settingClass = $this->itemClass;
103 103
         $query = $settingClass::find();
104 104
         $settings = $query->all();
105
-        if(!empty($settings)){
106
-            foreach ($settings as $setting){
105
+        if (!empty($settings)) {
106
+            foreach ($settings as $setting) {
107 107
                 if (in_array($setting->key, array_keys($this->attributes))) {
108 108
                     $this->settings[$setting->key] = $setting;
109 109
                     $this->{$setting->key} = $setting->value;
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
     }
127 127
 
128 128
     /** {@inheritdoc} */
129
-    public function save(){
130
-        if(!empty($this->settings)){
131
-            foreach ($this->settings as $key=> $setting){
129
+    public function save() {
130
+        if (!empty($this->settings)) {
131
+            foreach ($this->settings as $key=> $setting) {
132 132
                 if (in_array($setting->key, array_keys($this->attributes))) {
133 133
                     $setting->save();
134 134
                     $this->settings[$key] = $setting;
Please login to merge, or discard this patch.
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
         $model = static::find()
50 50
             ->andWhere([$this->keyColumn => $key])
51 51
             ->one();
Please login to merge, or discard this patch.