Completed
Push — master ( 40d170...cfb1a5 )
by Nikola
04:21
created
components/terms/BaseTerm.php 3 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -8,9 +8,7 @@
 block discarded – undo
8 8
 
9 9
 namespace nkostadinov\taxonomy\components\terms;
10 10
 
11
-use Aws\S3\Exception\AccessDeniedException;
12 11
 use nkostadinov\taxonomy\components\interfaces\ITaxonomyTermInterface;
13
-use nkostadinov\taxonomy\models\Taxonomy;
14 12
 use nkostadinov\taxonomy\models\TaxonomyDef;
15 13
 use nkostadinov\taxonomy\models\TaxonomyTerms;
16 14
 use yii\base\Exception;
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -74,8 +74,9 @@  discard block
 block discarded – undo
74 74
     }
75 75
 
76 76
     public function canInstall() {
77
-        if(!$this->getTable())
78
-            return 'Missing "table" property';
77
+        if(!$this->getTable()) {
78
+                    return 'Missing "table" property';
79
+        }
79 80
         return true;
80 81
     }
81 82
 
@@ -95,10 +96,12 @@  discard block
 block discarded – undo
95 96
 
96 97
     public function getRefTableName()
97 98
     {
98
-        if(strpos($this->refTable, '\\') === FALSE) //not an AR class but a table name
99
+        if(strpos($this->refTable, '\\') === FALSE) {
100
+            //not an AR class but a table name
99 101
             return $this->refTable;
100
-        else
101
-            return call_user_func([$this->refTable, 'tableName']);
102
+        } else {
103
+                    return call_user_func([$this->refTable, 'tableName']);
104
+        }
102 105
     }
103 106
 
104 107
     public function getTable()
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     }
75 75
 
76 76
     public function canInstall() {
77
-        if(!$this->getTable())
77
+        if (!$this->getTable())
78 78
             return 'Missing "table" property';
79 79
         return true;
80 80
     }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     public function getTaxonomyTerm($name, $create = true)
83 83
     {
84 84
         $term = TaxonomyTerms::findOne(['term'=>$name, 'taxonomy_id' => $this->id]);
85
-        if($create and !isset($term))
85
+        if ($create and !isset($term))
86 86
         {
87 87
             $term = new TaxonomyTerms();
88 88
             $term->taxonomy_id = $this->id;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
     public function getRefTableName()
97 97
     {
98
-        if(strpos($this->refTable, '\\') === FALSE) //not an AR class but a table name
98
+        if (strpos($this->refTable, '\\') === FALSE) //not an AR class but a table name
99 99
             return $this->refTable;
100 100
         else
101 101
             return call_user_func([$this->refTable, 'tableName']);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         if (!preg_match('/^\w+$/', $this->name)) {
117 117
             throw new Exception('The migration name should contain letters, digits and/or underscore characters only.');
118 118
         }
119
-        $name = 'm' . gmdate('ymd_His') . '_' . $this->name;
119
+        $name = 'm'.gmdate('ymd_His').'_'.$this->name;
120 120
         return $name;
121 121
     }
122 122
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     {
125 125
 
126 126
         $name = $this->getMigrationFile();
127
-        $file = \Yii::getAlias($this->migrationPath . DIRECTORY_SEPARATOR . $name . '.php');
127
+        $file = \Yii::getAlias($this->migrationPath.DIRECTORY_SEPARATOR.$name.'.php');
128 128
 
129 129
         //$data = get_object_vars($this);
130 130
         $data = [];
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         $data['migration'] = $name;
136 136
 
137 137
         $this->migration = $name;
138
-        $content = \Yii::$app->getView()->renderFile(\Yii::getAlias($this->templateFile), [ 'data' => $data ]);
138
+        $content = \Yii::$app->getView()->renderFile(\Yii::getAlias($this->templateFile), ['data' => $data]);
139 139
         file_put_contents($file, $content);
140 140
         return $name;
141 141
     }
Please login to merge, or discard this patch.
components/terms/PropertyTerm.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
13 13
 use yii\db\Migration;
14 14
 use yii\db\Query;
15 15
 use yii\db\Schema;
16
-use yii\helpers\ArrayHelper;
17 16
 
18 17
 class PropertyTerm extends BaseTerm {
19 18
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,8 +96,9 @@
 block discarded – undo
96 96
             ->innerJoin($this->getTable(), $this->getTable() . '.term_id = taxonomy_terms.id and ' . $this->getTable() . '.object_id=:object_id',
97 97
                 [':object_id' => $object_id])
98 98
             ->andFilterWhere([TaxonomyTerms::tableName() . '.term' => $name]);
99
-        foreach($query->all() as $v)
100
-            $result[$v['term']] = $v['value'];
99
+        foreach($query->all() as $v) {
100
+                    $result[$v['term']] = $v['value'];
101
+        }
101 102
         return isset($result) ? $result : [];
102 103
     }
103 104
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 class PropertyTerm extends BaseTerm {
19 19
 
20
-    public $templateFile = '@nkostadinov/taxonomy/migrations/template/properties.php' ;
20
+    public $templateFile = '@nkostadinov/taxonomy/migrations/template/properties.php';
21 21
 
22 22
     public $updateOnExist = true;
23 23
 
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
             'value' => Schema::TYPE_STRING,
34 34
         ]);
35 35
         if ($migration->db->driverName === 'mysql') {
36
-            $migration->addForeignKey('fk_' . $this->getTable() . '_' . $this->getRefTableName(), $this->getTable(), 'object_id', $this->getRefTableName(), 'id', 'CASCADE');
37
-            $migration->addForeignKey('fk_' . $this->getTable() . '_' . TaxonomyTerms::tableName(), $this->getTable(), 'term_id', TaxonomyTerms::tableName(), 'id', 'CASCADE');
36
+            $migration->addForeignKey('fk_'.$this->getTable().'_'.$this->getRefTableName(), $this->getTable(), 'object_id', $this->getRefTableName(), 'id', 'CASCADE');
37
+            $migration->addForeignKey('fk_'.$this->getTable().'_'.TaxonomyTerms::tableName(), $this->getTable(), 'term_id', TaxonomyTerms::tableName(), 'id', 'CASCADE');
38 38
         }
39 39
     }
40 40
 
41 41
     public function addTerm($object_id, $params)
42 42
     {
43
-        foreach($params as $item => $value) {
43
+        foreach ($params as $item => $value) {
44 44
             $term = TaxonomyTerms::findOne(['term' => $item, 'taxonomy_id' => $this->id]);
45 45
             if (!isset($term)) {
46 46
                 $term = new TaxonomyTerms();
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
                 } catch (Exception $e) {
67 67
                     $transaction->rollBack();
68 68
                 }
69
-            } elseif($this->updateOnExist) {
70
-                $this->getDb()->createCommand()->update($this->getTable(), [ 'value' => $value ], $data)->execute();
69
+            } elseif ($this->updateOnExist) {
70
+                $this->getDb()->createCommand()->update($this->getTable(), ['value' => $value], $data)->execute();
71 71
             }
72 72
         }
73 73
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     public function removeTerm($object_id, $params = [])
76 76
     {
77 77
         $terms = $this->getTerms($object_id, isset($params['name']) ? $params['name'] : []);
78
-        foreach($terms as $term=>$value) {
78
+        foreach ($terms as $term=>$value) {
79 79
             $term = $this->getTaxonomyTerm($term);
80 80
             $data['term_id'] = $term->id;
81 81
             $data['object_id'] = $object_id;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                 $this->getDb()->createCommand()->delete($this->getTable(), $data)->execute();
86 86
 
87 87
                 $term->updateCounters(['total_count' => -1]);
88
-                TaxonomyDef::updateAllCounters(['total_count' => -1], [ 'id' => $this->id ]);
88
+                TaxonomyDef::updateAllCounters(['total_count' => -1], ['id' => $this->id]);
89 89
             }
90 90
         }
91 91
     }
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
     public function getTerms($object_id, $name = [])
94 94
     {
95 95
         $query = (new Query())
96
-            ->select(TaxonomyTerms::tableName() . '.term, ' . $this->getTable() . '.value')
96
+            ->select(TaxonomyTerms::tableName().'.term, '.$this->getTable().'.value')
97 97
             ->from(TaxonomyTerms::tableName())
98
-            ->innerJoin($this->getTable(), $this->getTable() . '.term_id = taxonomy_terms.id and ' . $this->getTable() . '.object_id=:object_id',
98
+            ->innerJoin($this->getTable(), $this->getTable().'.term_id = taxonomy_terms.id and '.$this->getTable().'.object_id=:object_id',
99 99
                 [':object_id' => $object_id])
100
-            ->andFilterWhere([TaxonomyTerms::tableName() . '.term' => $name]);
101
-        foreach($query->all() as $v)
100
+            ->andFilterWhere([TaxonomyTerms::tableName().'.term' => $name]);
101
+        foreach ($query->all() as $v)
102 102
             $result[$v['term']] = $v['value'];
103 103
         return isset($result) ? $result : [];
104 104
     }
Please login to merge, or discard this patch.
controllers/DefController.php 4 patches
Doc Comments   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,6 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
 class Migrator extends \yii\console\controllers\MigrateController
21 21
 {
22
+    /**
23
+     * @param string $id
24
+     */
22 25
     public function __construct($id, $module, $config = [])
23 26
     {
24 27
         parent::__construct($id, $module, $config); // TODO: Change the autogenerated stub
@@ -64,7 +67,7 @@  discard block
 block discarded – undo
64 67
 
65 68
     /**
66 69
      * Lists all TaxonomyDef models.
67
-     * @return mixed
70
+     * @return string
68 71
      * @throws InvalidConfigException
69 72
      */
70 73
     public function actionIndex()
@@ -84,7 +87,7 @@  discard block
 block discarded – undo
84 87
     /**
85 88
      * Displays a single TaxonomyDef model.
86 89
      * @param integer $id
87
-     * @return mixed
90
+     * @return string
88 91
      */
89 92
     public function actionView($id)
90 93
     {
@@ -157,7 +160,7 @@  discard block
 block discarded – undo
157 160
      * Deletes an existing TaxonomyDef model.
158 161
      * If deletion is successful, the browser will be redirected to the 'index' page.
159 162
      * @param integer $id
160
-     * @return mixed
163
+     * @return \yii\web\Response
161 164
      */
162 165
     public function actionDelete($id)
163 166
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 use nkostadinov\taxonomy\models\TaxonomyDefSearch;
9 9
 use yii\base\InvalidConfigException;
10 10
 use yii\data\ActiveDataProvider;
11
-use yii\helpers\Url;
12 11
 use yii\web\Controller;
13 12
 use yii\web\NotFoundHttpException;
14 13
 use yii\filters\VerbFilter;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     {
29 29
         ob_start();
30 30
         //$this->migrationPath = Yii::getAlias($migrationPath);
31
-        if($this->beforeAction('up'))
31
+        if ($this->beforeAction('up'))
32 32
             $this->migrateUp($class);
33 33
         $result = ob_get_contents();
34 34
         return $result;
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     {
39 39
         ob_start();
40 40
         //$this->migrationPath = Yii::getAlias($migrationPath);
41
-        if($this->beforeAction('down'))
41
+        if ($this->beforeAction('down'))
42 42
             $this->migrateDown($class);
43 43
         $result = ob_get_contents();
44 44
         return $result;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function actionIndex()
71 71
     {
72
-        if(!$this->getComponent()->isInstalled())
72
+        if (!$this->getComponent()->isInstalled())
73 73
             throw new InvalidConfigException("Please run the migration first!");
74 74
 
75 75
         $searchModel = new TaxonomyDefSearch();
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
     public function getComponent()
194 194
     {
195
-        if(\Yii::$app->has($this->module->component))
195
+        if (\Yii::$app->has($this->module->component))
196 196
             return \Yii::$app->{$this->module->component};
197 197
         else
198 198
             throw new InvalidConfigException("Cannot find taxonomy component({$this->module->component})");
@@ -200,12 +200,12 @@  discard block
 block discarded – undo
200 200
 
201 201
     public function actionInstall()
202 202
     {
203
-        if(!$this->getComponent()->isInstalled() and \Yii::$app->request->isPost) {
203
+        if (!$this->getComponent()->isInstalled() and \Yii::$app->request->isPost) {
204 204
             //start installation
205
-            if($this->getComponent()) {
205
+            if ($this->getComponent()) {
206 206
                 $this->getComponent()->install();
207 207
 
208
-                $this->redirect(['/'.$this->module->id . '/' . $this->id . '/index']);
208
+                $this->redirect(['/'.$this->module->id.'/'.$this->id.'/index']);
209 209
             } else
210 210
                 throw new InvalidConfigException("Cannot find taxonomy component({$this->module->component})");
211 211
         }
Please login to merge, or discard this patch.
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@  discard block
 block discarded – undo
28 28
     {
29 29
         ob_start();
30 30
         //$this->migrationPath = Yii::getAlias($migrationPath);
31
-        if($this->beforeAction('up'))
32
-            $this->migrateUp($class);
31
+        if($this->beforeAction('up')) {
32
+                    $this->migrateUp($class);
33
+        }
33 34
         $result = ob_get_contents();
34 35
         return $result;
35 36
     }
@@ -38,8 +39,9 @@  discard block
 block discarded – undo
38 39
     {
39 40
         ob_start();
40 41
         //$this->migrationPath = Yii::getAlias($migrationPath);
41
-        if($this->beforeAction('down'))
42
-            $this->migrateDown($class);
42
+        if($this->beforeAction('down')) {
43
+                    $this->migrateDown($class);
44
+        }
43 45
         $result = ob_get_contents();
44 46
         return $result;
45 47
     }
@@ -69,8 +71,9 @@  discard block
 block discarded – undo
69 71
      */
70 72
     public function actionIndex()
71 73
     {
72
-        if(!$this->getComponent()->isInstalled())
73
-            throw new InvalidConfigException("Please run the migration first!");
74
+        if(!$this->getComponent()->isInstalled()) {
75
+                    throw new InvalidConfigException("Please run the migration first!");
76
+        }
74 77
 
75 78
         $searchModel = new TaxonomyDefSearch();
76 79
         $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
@@ -192,10 +195,11 @@  discard block
 block discarded – undo
192 195
 
193 196
     public function getComponent()
194 197
     {
195
-        if(\Yii::$app->has($this->module->component))
196
-            return \Yii::$app->{$this->module->component};
197
-        else
198
-            throw new InvalidConfigException("Cannot find taxonomy component({$this->module->component})");
198
+        if(\Yii::$app->has($this->module->component)) {
199
+                    return \Yii::$app->{$this->module->component};
200
+        } else {
201
+                    throw new InvalidConfigException("Cannot find taxonomy component({$this->module->component})");
202
+        }
199 203
     }
200 204
 
201 205
     public function actionInstall()
@@ -206,8 +210,9 @@  discard block
 block discarded – undo
206 210
                 $this->getComponent()->install();
207 211
 
208 212
                 $this->redirect(['/'.$this->module->id . '/' . $this->id . '/index']);
209
-            } else
210
-                throw new InvalidConfigException("Cannot find taxonomy component({$this->module->component})");
213
+            } else {
214
+                            throw new InvalidConfigException("Cannot find taxonomy component({$this->module->component})");
215
+            }
211 216
         }
212 217
         return $this->render('install');
213 218
     }
Please login to merge, or discard this patch.
models/TaxonomyDefSearch.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace nkostadinov\taxonomy\models;
4 4
 
5
-use Yii;
6 5
 use yii\base\Model;
7 6
 use yii\data\ActiveDataProvider;
8 7
 use nkostadinov\taxonomy\models\TaxonomyDef;
Please login to merge, or discard this patch.
behaviors/TagQuery.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@
 block discarded – undo
18 18
     {
19 19
         $this->joinTables();
20 20
 
21
-        if(!empty($tags))
21
+        if (!empty($tags))
22 22
             $this->getQuery()
23
-                ->andFilterWhere([ TaxonomyTerms::tableName() . '.term' => $tags ]);
23
+                ->andFilterWhere([TaxonomyTerms::tableName().'.term' => $tags]);
24 24
 
25 25
         return $this->getQuery();
26 26
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,9 +18,10 @@
 block discarded – undo
18 18
     {
19 19
         $this->joinTables();
20 20
 
21
-        if(!empty($tags))
22
-            $this->getQuery()
21
+        if(!empty($tags)) {
22
+                    $this->getQuery()
23 23
                 ->andFilterWhere([ TaxonomyTerms::tableName() . '.term' => $tags ]);
24
+        }
24 25
 
25 26
         return $this->getQuery();
26 27
     }
Please login to merge, or discard this patch.
behaviors/BaseTermBehavior.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
-  * User: Phreak
3
+ * User: Phreak
4 4
  * Date: 13.02.2015
5 5
  * Time: 09:31 ч.
6 6
  */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@
 block discarded – undo
22 22
 
23 23
         /** @var ActiveRecord $this->owner */
24 24
         $this->getQuery()
25
-            ->leftJoin($this->taxonomy->table, $this->taxonomy->table . '.object_id = ' . $model::tableName() . '.id')
26
-            ->leftJoin(TaxonomyTerms::tableName(), TaxonomyTerms::tableName() . '.id = ' . $this->taxonomy->table . '.term_id');
25
+            ->leftJoin($this->taxonomy->table, $this->taxonomy->table.'.object_id = '.$model::tableName().'.id')
26
+            ->leftJoin(TaxonomyTerms::tableName(), TaxonomyTerms::tableName().'.id = '.$this->taxonomy->table.'.term_id');
27 27
     }
28 28
 
29 29
     /**
Please login to merge, or discard this patch.
components/terms/TagTerm.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
 
15 15
 class TagTerm extends BaseTerm {
16 16
 
17
-    public $templateFile = '@nkostadinov/taxonomy/migrations/template/tag.php' ;
17
+    public $templateFile = '@nkostadinov/taxonomy/migrations/template/tag.php';
18 18
 
19 19
     public function addTerm($object_id, $params)
20 20
     {
21
-        foreach($params as $item) {
21
+        foreach ($params as $item) {
22 22
             $term = $this->getTaxonomyTerm($item);
23 23
             $data['term_id'] = $term->id;
24 24
             $data['object_id'] = $object_id;
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
                     $this->getDb()->createCommand()->insert($this->table, $data)->execute();
31 31
 
32 32
                     $term->updateCounters(['total_count' => 1]);
33
-                    TaxonomyDef::updateAllCounters(['total_count' => 1], [ 'id' => $this->id ]);
33
+                    TaxonomyDef::updateAllCounters(['total_count' => 1], ['id' => $this->id]);
34 34
 
35 35
                     $transaction->commit();
36 36
                 } catch (Exception $e) {
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function removeTerm($object_id, $params = [])
44 44
     {
45
-        if(empty($params))
45
+        if (empty($params))
46 46
             $params = $this->getTerms($object_id);
47
-        foreach($params as $item) {
47
+        foreach ($params as $item) {
48 48
             $term = $this->getTaxonomyTerm($item);
49 49
             $data['term_id'] = $term->id;
50 50
             $data['object_id'] = $object_id;
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
                 $this->getDb()->createCommand()->delete($this->table, $data)->execute();
55 55
 
56 56
                 $term->updateCounters(['total_count' => -1]);
57
-                Taxonomydef::updateAllCounters(['total_count' => -1], [ 'id' => $this->id ]);
57
+                Taxonomydef::updateAllCounters(['total_count' => -1], ['id' => $this->id]);
58 58
             }
59 59
         }
60 60
     }
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
     public function getTerms($object_id, $name = [])
63 63
     {
64 64
         $query = (new Query())
65
-            ->select(TaxonomyTerms::tableName() . '.term')
65
+            ->select(TaxonomyTerms::tableName().'.term')
66 66
             ->from(TaxonomyTerms::tableName())
67
-            ->innerJoin($this->table, $this->table . '.term_id = taxonomy_terms.id and ' . $this->table . '.object_id=:object_id',
67
+            ->innerJoin($this->table, $this->table.'.term_id = taxonomy_terms.id and '.$this->table.'.object_id=:object_id',
68 68
                 [':object_id' => $object_id])
69 69
             ->andFilterWhere(['taxonomy_terms.term' => $name]);
70 70
         $result = [];
71
-        foreach($query->all() as $v)
71
+        foreach ($query->all() as $v)
72 72
             $result[] = $v['term'];
73 73
         return $result;
74 74
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,8 +42,9 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function removeTerm($object_id, $params = [])
44 44
     {
45
-        if(empty($params))
46
-            $params = $this->getTerms($object_id);
45
+        if(empty($params)) {
46
+                    $params = $this->getTerms($object_id);
47
+        }
47 48
         foreach($params as $item) {
48 49
             $term = $this->getTaxonomyTerm($item);
49 50
             $data['term_id'] = $term->id;
@@ -68,8 +69,9 @@  discard block
 block discarded – undo
68 69
                 [':object_id' => $object_id])
69 70
             ->andFilterWhere(['taxonomy_terms.term' => $name]);
70 71
         $result = [];
71
-        foreach($query->all() as $v)
72
-            $result[] = $v['term'];
72
+        foreach($query->all() as $v) {
73
+                    $result[] = $v['term'];
74
+        }
73 75
         return $result;
74 76
     }
75 77
 }
Please login to merge, or discard this patch.
views/def/index.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 $message = Yii::$app->session->getFlash('info');
14 14
 ?>
15 15
 <div class="taxonomy-def-index">
16
-    <?php if(isset($message))
16
+    <?php if (isset($message))
17 17
         echo Alert::widget([
18 18
             'options' => [
19 19
                 'class' => 'alert-info',
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,13 +13,14 @@
 block discarded – undo
13 13
 $message = Yii::$app->session->getFlash('info');
14 14
 ?>
15 15
 <div class="taxonomy-def-index">
16
-    <?php if(isset($message))
16
+    <?php if(isset($message)) {
17 17
         echo Alert::widget([
18 18
             'options' => [
19 19
                 'class' => 'alert-info',
20 20
             ],
21 21
             'body' => nl2br($message),
22 22
         ]);
23
+}
23 24
     ?>
24 25
 
25 26
     <h1><?= Html::encode($this->title) ?></h1>
Please login to merge, or discard this patch.
views/def/update.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 /* @var $this yii\web\View */
6 6
 /* @var $model nkostadinov\taxonomy\models\TaxonomyDef */
7 7
 
8
-$this->title = 'Update Taxonomy Def: ' . ' ' . $model->name;
8
+$this->title = 'Update Taxonomy Def: '.' '.$model->name;
9 9
 $this->params['breadcrumbs'][] = ['label' => 'Taxonomy Defs', 'url' => ['index']];
10 10
 $this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
11 11
 $this->params['breadcrumbs'][] = 'Update';
Please login to merge, or discard this patch.