Completed
Push — 8.x-1.x ( 2a7b34...3d8643 )
by Janez
03:43
created
src/Plugin/Field/FieldWidget/EntityReference.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
       }
151 151
     }
152 152
 
153
-    $id = Html::getUniqueId('field-' . $this->fieldDefinition->getName() . '-display-settings-wrapper');
153
+    $id = Html::getUniqueId('field-'.$this->fieldDefinition->getName().'-display-settings-wrapper');
154 154
     $element['field_widget_display'] = [
155 155
       '#title' => t('Entity display plugin'),
156 156
       '#type' => 'select',
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
       '#type' => 'fieldset',
185 185
       '#title' => t('Entity display plugin configuration'),
186 186
       '#tree' => TRUE,
187
-      '#prefix' => '<div id="' . $id . '">',
187
+      '#prefix' => '<div id="'.$id.'">',
188 188
       '#suffix' => '</div>',
189 189
     ];
190 190
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
    *   A key for form state storage.
282 282
    */
283 283
   protected function getFormStateKey(FieldItemListInterface $items) {
284
-    return $items->getEntity()->uuid() . ':' . $items->getFieldDefinition()->getName();
284
+    return $items->getEntity()->uuid().':'.$items->getFieldDefinition()->getName();
285 285
   }
286 286
 
287 287
   /**
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
       }
318 318
       // Submit was triggered by one of the "Remove" buttons. We need to walk
319 319
       // few levels up to read value of "target_id" element.
320
-      elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], $this->fieldDefinition->getName() . '_remove_') === 0) {
320
+      elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], $this->fieldDefinition->getName().'_remove_') === 0) {
321 321
         $parents = array_merge(array_slice($trigger['#parents'], 0, -static::$deleteDepth), ['target_id']);
322 322
       }
323 323
 
@@ -354,8 +354,8 @@  discard block
 block discarded – undo
354 354
     // results.
355 355
     $form_state->set(['entity_browser_widget', $this->getFormStateKey($items)], $ids);
356 356
 
357
-    $hidden_id = Html::getUniqueId('edit-' . $this->fieldDefinition->getName() . '-target-id');
358
-    $details_id = Html::getUniqueId('edit-' . $this->fieldDefinition->getName());
357
+    $hidden_id = Html::getUniqueId('edit-'.$this->fieldDefinition->getName().'-target-id');
358
+    $details_id = Html::getUniqueId('edit-'.$this->fieldDefinition->getName());
359 359
     /** @var \Drupal\entity_browser\EntityBrowserInterface $entity_browser */
360 360
     $entity_browser = $this->entityManager->getStorage('entity_browser')->load($this->getSetting('entity_browser'));
361 361
 
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
       '#theme_wrappers' => ['container'],
486 486
       '#attributes' => ['class' => ['entities-list']],
487 487
       'items' => array_map(
488
-        function (ContentEntityInterface $entity) use ($field_widget_display, $details_id, $field_parents) {
488
+        function(ContentEntityInterface $entity) use ($field_widget_display, $details_id, $field_parents) {
489 489
           $display = $field_widget_display->view($entity);
490 490
           if (is_string($display)) {
491 491
             $display = ['#markup' => $display];
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
                 'wrapper' => $details_id,
506 506
               ],
507 507
               '#submit' => [[get_class($this), 'removeItemSubmit']],
508
-              '#name' => $this->fieldDefinition->getName() . '_remove_' . $entity->id(),
508
+              '#name' => $this->fieldDefinition->getName().'_remove_'.$entity->id(),
509 509
               '#limit_validation_errors' => [array_merge($field_parents, [$this->fieldDefinition->getName()])],
510 510
               '#attributes' => ['data-entity-id' => $entity->id()],
511 511
               '#access' => (bool) $this->getSetting('field_widget_remove')
Please login to merge, or discard this patch.