Completed
Push — 8.x-1.x ( cb246a...c66f75 )
by Janez
02:27
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.