Completed
Push — 8.x-1.x ( 7befb5...513fc9 )
by Janez
02:24
created
src/Plugin/Field/FieldWidget/FileBrowserWidget.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -175,8 +175,7 @@  discard block
 block discarded – undo
175 175
     // their styles in code.
176 176
     elseif ($this->fieldDefinition->getType() == 'image' && $image_style = ImageStyle::load($image_style_setting)) {
177 177
       $preview_image_style = $this->t('Preview image style: @style', ['@style' => $image_style->label()]);
178
-    }
179
-    else {
178
+    } else {
180 179
       $preview_image_style = $this->t('No preview image');
181 180
     }
182 181
     array_unshift($summary, $preview_image_style);
@@ -260,8 +259,7 @@  discard block
 block discarded – undo
260 259
           if ($field_type == 'file') {
261 260
             $description = $item->description;
262 261
             $display_field = $item->display;
263
-          }
264
-          elseif ($field_type == 'image') {
262
+          } elseif ($field_type == 'image') {
265 263
             $alt = $item->alt;
266 264
             $title = $item->title;
267 265
             $width = $item->width;
@@ -455,8 +453,7 @@  discard block
 block discarded – undo
455 453
       $extensions = isset($settings['file_extensions']) ? $settings['file_extensions'] : implode(' ', $supported_extensions);
456 454
       $extensions = array_intersect(explode(' ', $extensions), $supported_extensions);
457 455
       $validators['file_validate_extensions'] = [implode(' ', $extensions)];
458
-    }
459
-    elseif (!empty($settings['file_extensions'])) {
456
+    } elseif (!empty($settings['file_extensions'])) {
460 457
       $validators['file_validate_extensions'] = [$settings['file_extensions']];
461 458
     }
462 459
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
     $delta = 0;
218 218
 
219
-    $order_class = $field_machine_name . '-delta-order';
219
+    $order_class = $field_machine_name.'-delta-order';
220 220
 
221 221
     $current = [
222 222
       '#type' => 'table',
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
       $current[$entity_id] = [
284 284
         '#attributes' => [
285 285
           'class' => ['draggable'],
286
-          'data-entity-id' => $entity->getEntityTypeId() . ':' . $entity_id,
286
+          'data-entity-id' => $entity->getEntityTypeId().':'.$entity_id,
287 287
           'data-row-id' => $delta,
288 288
         ],
289 289
       ];
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
             'options' => ['query' => ['details_id' => $details_id]],
356 356
           ],
357 357
           '#attributes' => [
358
-            'data-entity-id' => $entity->getEntityTypeId() . ':' . $entity->id(),
358
+            'data-entity-id' => $entity->getEntityTypeId().':'.$entity->id(),
359 359
             'data-row-id' => $delta,
360 360
           ],
361 361
           '#access' => $can_edit,
@@ -368,10 +368,10 @@  discard block
 block discarded – undo
368 368
             'wrapper' => $details_id,
369 369
           ],
370 370
           '#submit' => [[get_class($this), 'removeItemSubmit']],
371
-          '#name' => $field_machine_name . '_remove_' . $entity_id . '_' . md5(json_encode($field_parents)),
371
+          '#name' => $field_machine_name.'_remove_'.$entity_id.'_'.md5(json_encode($field_parents)),
372 372
           '#limit_validation_errors' => [array_merge($field_parents, [$field_machine_name, 'target_id'])],
373 373
           '#attributes' => [
374
-            'data-entity-id' => $entity->getEntityTypeId() . ':' . $entity->id(),
374
+            'data-entity-id' => $entity->getEntityTypeId().':'.$entity->id(),
375 375
             'data-row-id' => $delta,
376 376
           ],
377 377
           '#access' => (bool) $widget_settings['field_widget_remove'],
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
     }
430 430
 
431 431
     // Return ourself as the structure doesn't match the default.
432
-    usort($return, function ($a, $b) {
432
+    usort($return, function($a, $b) {
433 433
       return SortArray::sortByKeyInt($a, $b, '_weight');
434 434
     });
435 435
 
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
     $data['validators']['file'] = ['validators' => $this->getFileValidators()];
490 490
     // Provide context for widgets to enhance their configuration. Currently
491 491
     // we only know that "upload_location" is used.
492
-    $data['widget_context']['upload_location'] = $settings['uri_scheme'] . '://' . $settings['file_directory'];
492
+    $data['widget_context']['upload_location'] = $settings['uri_scheme'].'://'.$settings['file_directory'];
493 493
     return $data;
494 494
   }
495 495
 
Please login to merge, or discard this patch.
src/Form/GeneralInfoConfig.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
     $entity_browser = $cached_values['entity_browser'];
91 91
 
92 92
     if (empty($entity_browser->id())) {
93
-      $help_text = '<div class="clearfix eb-help-text"><h2>' . $this->t('Entity Browser creation instructions') . '</h2>';
94
-      $help_text .= '<p>' . $this->t('This is a multi-step form. In this first step you need to define the main characteristics of the Entity Browser (in other words, which plugins will be used for each functionality). In the following steps of this wizard, each individual plugin can be configured, when necessary.') . '</p>';
95
-      $help_text .= '<p>' . $this->t('You can find more detailed information about creating and configuring Entity Browsers at the <a href="@guide_href" target="_blank">official documentation</a>.', ['@guide_href' => 'https://drupal-media.gitbooks.io/drupal8-guide/content/modules/entity_browser/intro.html']) . '</p>';
93
+      $help_text = '<div class="clearfix eb-help-text"><h2>'.$this->t('Entity Browser creation instructions').'</h2>';
94
+      $help_text .= '<p>'.$this->t('This is a multi-step form. In this first step you need to define the main characteristics of the Entity Browser (in other words, which plugins will be used for each functionality). In the following steps of this wizard, each individual plugin can be configured, when necessary.').'</p>';
95
+      $help_text .= '<p>'.$this->t('You can find more detailed information about creating and configuring Entity Browsers at the <a href="@guide_href" target="_blank">official documentation</a>.', ['@guide_href' => 'https://drupal-media.gitbooks.io/drupal8-guide/content/modules/entity_browser/intro.html']).'</p>';
96 96
       $help_text .= '</div>';
97 97
       $form['help_text'] = [
98 98
         '#markup' => $help_text,
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
     }
101 101
 
102 102
     $displays = [];
103
-    $display_description = $this->t('Choose here how the browser(s) should be presented to the end user. The available plugins are:') . '<ul>';
103
+    $display_description = $this->t('Choose here how the browser(s) should be presented to the end user. The available plugins are:').'<ul>';
104 104
     foreach ($this->displayManager->getDefinitions() as $plugin_id => $plugin_definition) {
105 105
       $displays[$plugin_id] = $plugin_definition['label'];
106
-      $display_description .= '<li><b>' . $plugin_definition['label'] . ':</b> ' . $plugin_definition['description'] . '</li>';
106
+      $display_description .= '<li><b>'.$plugin_definition['label'].':</b> '.$plugin_definition['description'].'</li>';
107 107
     }
108 108
     $display_description .= '</ul>';
109 109
     $form['display'] = [
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
     ];
117 117
 
118 118
     $widget_selectors = [];
119
-    $widget_description = $this->t('In the last step of the entity browser configuration you can decide how the widgets will be available to the editor. The available plugins are:') . '<ul>';
119
+    $widget_description = $this->t('In the last step of the entity browser configuration you can decide how the widgets will be available to the editor. The available plugins are:').'<ul>';
120 120
     foreach ($this->widgetSelectorManager->getDefinitions() as $plugin_id => $plugin_definition) {
121 121
       $widget_selectors[$plugin_id] = $plugin_definition['label'];
122
-      $widget_description .= '<li><b>' . $plugin_definition['label'] . ':</b> ' . $plugin_definition['description'] . '</li>';
122
+      $widget_description .= '<li><b>'.$plugin_definition['label'].':</b> '.$plugin_definition['description'].'</li>';
123 123
     }
124 124
     $widget_description .= '</ul>';
125 125
     $form['widget_selector'] = [
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
     ];
133 133
 
134 134
     $selection_display = [];
135
-    $selection_description = $this->t('You can optionally allow a "work-in-progress selection zone" to be available to the editor, while still navigating, browsing and selecting the entities. The available plugins are:') . '<ul>';
135
+    $selection_description = $this->t('You can optionally allow a "work-in-progress selection zone" to be available to the editor, while still navigating, browsing and selecting the entities. The available plugins are:').'<ul>';
136 136
     foreach ($this->selectionDisplayManager->getDefinitions() as $plugin_id => $plugin_definition) {
137 137
       $selection_display[$plugin_id] = $plugin_definition['label'];
138
-      $selection_description .= '<li><b>' . $plugin_definition['label'] . ':</b> ' . $plugin_definition['description'] . '</li>';
138
+      $selection_description .= '<li><b>'.$plugin_definition['label'].':</b> '.$plugin_definition['description'].'</li>';
139 139
     }
140 140
     $selection_description .= '</ul>';
141 141
     $form['selection_display'] = [
Please login to merge, or discard this patch.