Test Setup Failed
Branch master (08f2f9)
by Andrey
01:08
created
src/TableMultilanguage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
      */
91 91
     public function run(): string
92 92
     {
93
-        if (null === $this->languageModel){
93
+        if (null === $this->languageModel) {
94 94
             throw new InvalidConfigException('Language model is not defined.');
95 95
         }
96 96
 
Please login to merge, or discard this patch.
src/views/fieldsMultilanguage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
             <?php foreach ($fields as $field): ?>
34 34
 
35
-                <?php if (null === $field || empty($field)){continue;} ?>
35
+                <?php if (null === $field || empty($field)) {continue; } ?>
36 36
 
37 37
                 <?php echo FieldType::widget(ArrayHelper::merge($field, [
38 38
                     'model' => $model,
Please login to merge, or discard this patch.
src/views/tableMultilanguage.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         <?php foreach ($languageModel->getLanguageList() as $language): ?>
30 30
 
31 31
         <td>
32
-            <?php if ($field['name']== 'image'): ?>
32
+            <?php if ($field['name'] == 'image'): ?>
33 33
                 <?php echo  Html::img(TableMultilanguageField::widget(
34 34
                                 ArrayHelper::merge($field,
35 35
                                     [
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@  discard block
 block discarded – undo
40 40
                             )
41 41
                         ); ?>
42 42
 
43
-            <?php else: ?>
43
+            <?php else {
44
+    : ?>
44 45
 
45 46
                 <?php echo TableMultilanguageField::widget(
46 47
                                 ArrayHelper::merge($field,
@@ -51,7 +52,9 @@  discard block
 block discarded – undo
51 52
                                 )
52 53
                             ) ?>
53 54
 
54
-            <?php endif; ?>
55
+            <?php endif;
56
+}
57
+?>
55 58
 
56 59
         </td>
57 60
 
Please login to merge, or discard this patch.
src/views/fieldsSimple.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 <div>
13 13
     <?php foreach ($fields as $field): ?>
14 14
 
15
-        <?php if (null === $field || empty($field)){continue;} ?>
15
+        <?php if (null === $field || empty($field)) {continue; } ?>
16 16
 
17 17
         <?php echo FieldType::widget(ArrayHelper::merge($field, [
18 18
             'model' => $model,
Please login to merge, or discard this patch.
src/FieldType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function run()
137 137
     {
138
-        if ($this->hide){
138
+        if ($this->hide) {
139 139
             return '';
140 140
         }
141 141
 
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             'preset'  => $this->preset,
251 251
         ];
252 252
 
253
-        if ($this->language !== null){
253
+        if ($this->language !== null) {
254 254
             $config['language'] = $this->language;
255 255
         }
256 256
 
@@ -292,11 +292,11 @@  discard block
 block discarded – undo
292 292
      */
293 293
     protected function getFieldName(): string
294 294
     {
295
-        if ($this->language === null){
295
+        if ($this->language === null) {
296 296
             return $this->name;
297 297
         }
298 298
 
299
-        return $this->name . '_' . strtolower($this->language->getShortName());
299
+        return $this->name.'_'.strtolower($this->language->getShortName());
300 300
     }
301 301
 
302 302
     /**
Please login to merge, or discard this patch.
src/Fields.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@
 block discarded – undo
156 156
             'form'   => $this->form,
157 157
         ];
158 158
 
159
-        if ($this->languageModel === null){
159
+        if ($this->languageModel === null) {
160 160
             $template = 'fieldsSimple';
161 161
         } else {
162 162
             $template = 'fieldsMultilanguage';
Please login to merge, or discard this patch.
src/TableMultilanguageField.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function run(): string
78 78
     {
79
-        if (null === $this->language){
79
+        if (null === $this->language) {
80 80
             throw  new InvalidConfigException('Language model is not defined.');
81 81
         }
82 82
 
83
-        if (strpos($this->name, '.') !== false){
83
+        if (strpos($this->name, '.') !== false) {
84 84
 
85 85
             $out = $this->getDataByPath($this->name);
86 86
 
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
         $namePath = explode('.', $name);
105 105
         $out = $this->model;
106 106
 
107
-        for ($i=0; $i < count($namePath); $i++){
107
+        for ($i = 0; $i < count($namePath); $i++) {
108 108
 
109 109
             $out = $i+1 < count($namePath) ? $out->{$namePath[$i]} : $out->{$namePath[$i].'_'.$this->language->getShortName()};
110 110
 
111 111
             if (is_array($out)) {
112
-                for ($j=0; $j < count($out); $j++) {
112
+                for ($j = 0; $j < count($out); $j++) {
113 113
                     $out[$j] = $out[$j]->{$namePath[$i+1].'_'.$this->language->getShortName()};
114 114
                 }
115 115
                 $out = implode(', ', $out);
Please login to merge, or discard this patch.