Completed
Push — 8.x-1.x ( 6da39e...b20e5f )
by Janez
02:54
created
src/Plugin/Field/FieldFormatter/FallbackFormatter.php 2 patches
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -174,11 +174,9 @@  discard block
 block discarded – undo
174 174
     foreach ($settings['formatters'] as $name => $options) {
175 175
       if (!isset($formatters[$name])) {
176 176
         $summary_items[] = t('Unknown formatter %name.', array('%name' => $name));
177
-      }
178
-      elseif (!in_array($this->fieldDefinition->getType(), $formatters[$name]['field_types'])) {
177
+      } elseif (!in_array($this->fieldDefinition->getType(), $formatters[$name]['field_types'])) {
179 178
         $summary_items[] = t('Invalid formatter %name.', array('%name' => $formatters[$name]['label']));
180
-      }
181
-      else {
179
+      } else {
182 180
 
183 181
         $formatter_instance = $this->getFormatter($options);
184 182
         $result = $formatter_instance->settingsSummary();
@@ -196,8 +194,7 @@  discard block
 block discarded – undo
196 194
         '#prefix' => '<strong>',
197 195
         '#suffix' => '</strong>',
198 196
       );
199
-    }
200
-    else {
197
+    } else {
201 198
       $summary = array(
202 199
         '#theme' => 'item_list',
203 200
         '#items' => $summary_items,
@@ -300,11 +297,9 @@  discard block
 block discarded – undo
300 297
       // Check that the field type is allowed for the formatter.
301 298
       elseif (!in_array($field_type, $info['field_types'])) {
302 299
         continue;
303
-      }
304
-      elseif (!$info['class']::isApplicable($this->fieldDefinition)) {
300
+      } elseif (!$info['class']::isApplicable($this->fieldDefinition)) {
305 301
         continue;
306
-      }
307
-      else {
302
+      } else {
308 303
         $return[$formatter] = $info;
309 304
       }
310 305
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -257,7 +257,7 @@
 block discarded – undo
257 257
           '#template' => '<strong>{{ label }}</strong>{{ settings_summary|raw }}',
258 258
           '#context' => [
259 259
             'label' => $formatter_instance->getPluginDefinition()['label'],
260
-            'settings_summary' => '<br>' . Xss::filter(!empty($result) ? implode(', ', $result) : ''),
260
+            'settings_summary' => '<br>'.Xss::filter(!empty($result) ? implode(', ', $result) : ''),
261 261
           ],
262 262
         ];
263 263
       }
Please login to merge, or discard this patch.