Completed
Push — 8.x-1.x ( 729d7d...e0281d )
by Janez
02:47
created
src/Plugin/EntityBrowser/SelectionDisplay/View.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,14 +84,14 @@
 block discarded – undo
84 84
     $views = Views::getAllViews();
85 85
     foreach ($views as $view_id => $view) {
86 86
       foreach ($view->get('display') as $display_id => $display) {
87
-        $options[$view_id . '.' . $display_id] = $this->t('@view : @display', array('@view' => $view->label(), '@display' => $display['display_title']));
87
+        $options[$view_id.'.'.$display_id] = $this->t('@view : @display', array('@view' => $view->label(), '@display' => $display['display_title']));
88 88
       }
89 89
     }
90 90
 
91 91
     $form['view'] = [
92 92
       '#type' => 'select',
93 93
       '#title' => $this->t('View : View display'),
94
-      '#default_value' => $this->configuration['view'] . '.' . $this->configuration['view_display'],
94
+      '#default_value' => $this->configuration['view'].'.'.$this->configuration['view_display'],
95 95
       '#options' => $options,
96 96
       '#required' => TRUE,
97 97
       '#description' => 'View display to use for displaying currently selected items. Do note that to get something usefull out of this display, its first contextual filter should be a filter on the primary identifier field of your entity type (e.g., Node ID, Media ID).',
Please login to merge, or discard this patch.
src/Plugin/EntityBrowser/Display/IFrame.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             'entity_browser' => [
149 149
               'iframe' => [
150 150
                 $uuid => [
151
-                  'src' => Url::fromRoute('entity_browser.' . $this->configuration['entity_browser_id'], [], $data['query_parameters'])
151
+                  'src' => Url::fromRoute('entity_browser.'.$this->configuration['entity_browser_id'], [], $data['query_parameters'])
152 152
                     ->toString(),
153 153
                   'width' => $this->configuration['width'],
154 154
                   'height' => $this->configuration['height'],
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
   public function propagateSelection(FilterResponseEvent $event) {
183 183
     $render = [
184 184
       'labels' => [
185
-        '#markup' => 'Labels: ' . implode(', ', array_map(function (EntityInterface $item) {
185
+        '#markup' => 'Labels: '.implode(', ', array_map(function(EntityInterface $item) {
186 186
           return $item->label();
187 187
         }, $this->entities)),
188 188
         '#attached' => [
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
           'drupalSettings' => [
191 191
             'entity_browser' => [
192 192
               'iframe' => [
193
-                'entities' => array_map(function (EntityInterface $item) {
193
+                'entities' => array_map(function(EntityInterface $item) {
194 194
                   return [$item->id(), $item->uuid(), $item->getEntityTypeId()];
195 195
                 }, $this->entities),
196 196
                 'uuid' => $this->request->query->get('uuid'),
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
    * {@inheritdoc}
209 209
    */
210 210
   public function path() {
211
-    return '/entity-browser/iframe/' . $this->configuration['entity_browser_id'];
211
+    return '/entity-browser/iframe/'.$this->configuration['entity_browser_id'];
212 212
   }
213 213
 
214 214
   /**
Please login to merge, or discard this patch.
modules/entity_form/src/Plugin/EntityBrowser/Widget/EntityForm.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
    * {@inheritdoc}
97 97
    */
98 98
   public function getForm(array &$original_form, FormStateInterface $form_state, array $aditional_widget_parameters) {
99
-    if (empty($this->configuration['entity_type']) || empty($this->configuration['bundle'])  || empty($this->configuration['form_mode'])) {
99
+    if (empty($this->configuration['entity_type']) || empty($this->configuration['bundle']) || empty($this->configuration['form_mode'])) {
100 100
       return ['#markup' => t('The settings for this widget (Entity type, Bundle or Form mode) are not configured correctly.')];
101 101
     }
102 102
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     $definitions = $this->entityTypeManager->getDefinitions();
138 138
     $entity_types = array_combine(
139 139
       array_keys($definitions),
140
-      array_map(function (EntityTypeInterface $item) {
140
+      array_map(function(EntityTypeInterface $item) {
141 141
         return $item->getLabel();
142 142
       }, $definitions)
143 143
     );
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     $bundles = [];
156 156
     if ($entity_type) {
157 157
       $definitions = $this->entityTypeBundleInfo->getBundleInfo($entity_type);
158
-      $bundles = array_map(function ($item) {
158
+      $bundles = array_map(function($item) {
159 159
         return $item['label'];
160 160
       }, $definitions);
161 161
     }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         '#options' => $bundles,
169 169
         '#default_value' => $bundle,
170 170
       ],
171
-      '#attributes' => ['id' => 'bundle-wrapper-' . $this->uuid()],
171
+      '#attributes' => ['id' => 'bundle-wrapper-'.$this->uuid()],
172 172
     ];
173 173
 
174 174
     $form['form_mode'] = [
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         '#default_value' => $form_mode,
180 180
         '#options' => $this->entityDisplayRepository->getFormModeOptions($entity_type),
181 181
       ],
182
-      '#attributes' => ['id' => 'form-mode-wrapper-' . $this->uuid()],
182
+      '#attributes' => ['id' => 'form-mode-wrapper-'.$this->uuid()],
183 183
     ];
184 184
 
185 185
     return $form;
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
    */
205 205
   public function updateFormElements($form, FormStateInterface $form_state) {
206 206
     $response = new AjaxResponse();
207
-    $response->addCommand(new ReplaceCommand('#bundle-wrapper-' . $this->uuid(), $this->updateBundle($form, $form_state)));
208
-    $response->addCommand(new ReplaceCommand('#form-mode-wrapper-' . $this->uuid(), $this->updateFormMode($form, $form_state)));
207
+    $response->addCommand(new ReplaceCommand('#bundle-wrapper-'.$this->uuid(), $this->updateBundle($form, $form_state)));
208
+    $response->addCommand(new ReplaceCommand('#form-mode-wrapper-'.$this->uuid(), $this->updateFormMode($form, $form_state)));
209 209
     return $response;
210 210
   }
211 211
 
Please login to merge, or discard this patch.
src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -216,12 +216,10 @@  discard block
 block discarded – undo
216 216
 
217 217
     if (empty($entity_browser_id)) {
218 218
       return [t('No entity browser selected.')];
219
-    }
220
-    else {
219
+    } else {
221 220
       if ($browser = $this->entityManager->getStorage('entity_browser')->load($entity_browser_id)) {
222 221
         $summary[] = t('Entity browser: @browser', ['@browser' => $browser->label()]);
223
-      }
224
-      else {
222
+      } else {
225 223
         drupal_set_message(t('Missing entity browser!'), 'error');
226 224
         return [t('Missing entity browser!')];
227 225
       }
@@ -421,8 +419,7 @@  discard block
 block discarded – undo
421 419
     // information to return correct part of the form.
422 420
     if (!empty($trigger['#ajax']['event']) && $trigger['#ajax']['event'] == 'entity_browser_value_updated') {
423 421
       $parents = array_slice($trigger['#array_parents'], 0, -1);
424
-    }
425
-    elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], '_remove_')) {
422
+    } elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], '_remove_')) {
426 423
       $parents = array_slice($trigger['#array_parents'], 0, -static::$deleteDepth);
427 424
     }
428 425
 
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
       }
147 147
     }
148 148
 
149
-    $id = Html::getUniqueId('field-' . $this->fieldDefinition->getName() . '-display-settings-wrapper');
149
+    $id = Html::getUniqueId('field-'.$this->fieldDefinition->getName().'-display-settings-wrapper');
150 150
     $element['field_widget_display'] = [
151 151
       '#title' => t('Entity display plugin'),
152 152
       '#type' => 'select',
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
       '#type' => 'fieldset',
181 181
       '#title' => t('Entity display plugin configuration'),
182 182
       '#tree' => TRUE,
183
-      '#prefix' => '<div id="' . $id . '">',
183
+      '#prefix' => '<div id="'.$id.'">',
184 184
       '#suffix' => '</div>',
185 185
     ];
186 186
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
    *   A key for form state storage.
279 279
    */
280 280
   protected function getFormStateKey(FieldItemListInterface $items) {
281
-    return $items->getEntity()->uuid() . ':' . $items->getFieldDefinition()->getName();
281
+    return $items->getEntity()->uuid().':'.$items->getFieldDefinition()->getName();
282 282
   }
283 283
 
284 284
   /**
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
       }
316 316
       // Submit was triggered by one of the "Remove" buttons. We need to walk
317 317
       // few levels up to read value of "target_id" element.
318
-      elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], $this->fieldDefinition->getName() . '_remove_') === 0) {
318
+      elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], $this->fieldDefinition->getName().'_remove_') === 0) {
319 319
         $parents = array_merge(array_slice($trigger['#parents'], 0, -static::$deleteDepth), ['target_id']);
320 320
       }
321 321
 
@@ -351,8 +351,8 @@  discard block
 block discarded – undo
351 351
     // might result in unpredictable results.
352 352
     $form_state->set(['entity_browser_widget', $this->getFormStateKey($items)], $ids);
353 353
 
354
-    $hidden_id = Html::getUniqueId('edit-' . $this->fieldDefinition->getName() . '-target-id');
355
-    $details_id = Html::getUniqueId('edit-' . $this->fieldDefinition->getName());
354
+    $hidden_id = Html::getUniqueId('edit-'.$this->fieldDefinition->getName().'-target-id');
355
+    $details_id = Html::getUniqueId('edit-'.$this->fieldDefinition->getName());
356 356
 
357 357
     $element += [
358 358
       '#id' => $details_id,
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         // We need to repeat ID here as it is otherwise skipped when rendering.
368 368
         '#attributes' => ['id' => $hidden_id],
369 369
         '#default_value' => array_map(
370
-          function (EntityInterface $item) { return $item->getEntityTypeId() . ':' . $item->id(); },
370
+          function(EntityInterface $item) { return $item->getEntityTypeId().':'.$item->id(); },
371 371
           $entities
372 372
         ),
373 373
         // #ajax is officially not supported for hidden elements but if we
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
    */
410 410
   public static function processEntityBrowser(&$element, FormStateInterface $form_state, &$complete_form) {
411 411
     $uuid = key($element['#attached']['drupalSettings']['entity_browser']);
412
-    $element['#attached']['drupalSettings']['entity_browser'][$uuid]['selector'] = '#' . $element['#custom_hidden_id'];
412
+    $element['#attached']['drupalSettings']['entity_browser'][$uuid]['selector'] = '#'.$element['#custom_hidden_id'];
413 413
     return $element;
414 414
   }
415 415
 
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
       '#theme_wrappers' => ['container'],
513 513
       '#attributes' => ['class' => ['entities-list']],
514 514
       'items' => array_map(
515
-        function (ContentEntityInterface $entity) use ($field_widget_display, $details_id, $field_parents) {
515
+        function(ContentEntityInterface $entity) use ($field_widget_display, $details_id, $field_parents) {
516 516
           $display = $field_widget_display->view($entity);
517 517
           if (is_string($display)) {
518 518
             $display = ['#markup' => $display];
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
             '#theme_wrappers' => ['container'],
522 522
             '#attributes' => [
523 523
               'class' => ['item-container', Html::getClass($field_widget_display->getPluginId())],
524
-              'data-entity-id' => $entity->getEntityTypeId() . ':' . $entity->id(),
524
+              'data-entity-id' => $entity->getEntityTypeId().':'.$entity->id(),
525 525
             ],
526 526
             'display' => $display,
527 527
             'remove_button' => [
@@ -532,9 +532,9 @@  discard block
 block discarded – undo
532 532
                 'wrapper' => $details_id,
533 533
               ],
534 534
               '#submit' => [[get_class($this), 'removeItemSubmit']],
535
-              '#name' => $this->fieldDefinition->getName() . '_remove_' . $entity->id(),
535
+              '#name' => $this->fieldDefinition->getName().'_remove_'.$entity->id(),
536 536
               '#limit_validation_errors' => [array_merge($field_parents, [$this->fieldDefinition->getName()])],
537
-              '#attributes' => ['data-entity-id' => $entity->getEntityTypeId() . ':' . $entity->id()],
537
+              '#attributes' => ['data-entity-id' => $entity->getEntityTypeId().':'.$entity->id()],
538 538
               '#access' => (bool) $this->getSetting('field_widget_remove'),
539 539
             ],
540 540
             'edit_button' => [
Please login to merge, or discard this patch.
src/Plugin/Field/FieldWidget/FileBrowserWidget.php 2 patches
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -177,8 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
     if (empty($entity_browser_id)) {
179 179
       return [$this->t('No entity browser selected.')];
180
-    }
181
-    else {
180
+    } else {
182 181
       $browser = $this->entityTypeManager->getStorage('entity_browser')
183 182
         ->load($entity_browser_id);
184 183
       $summary[] = $this->t('Entity browser: @browser', ['@browser' => $browser->label()]);
@@ -194,8 +193,7 @@  discard block
 block discarded – undo
194 193
       // their styles in code.
195 194
       if (isset($image_styles[$image_style_setting])) {
196 195
         $preview_image_style = $this->t('Preview image style: @style', ['@style' => $image_styles[$image_style_setting]]);
197
-      }
198
-      else {
196
+      } else {
199 197
         $preview_image_style = $this->t('No preview image');
200 198
       }
201 199
     }
@@ -263,8 +261,7 @@  discard block
 block discarded – undo
263 261
         if ($image->isValid()) {
264 262
           $width = $image->getWidth();
265 263
           $height = $image->getHeight();
266
-        }
267
-        else {
264
+        } else {
268 265
           $width = $height = NULL;
269 266
         }
270 267
 
@@ -276,8 +273,7 @@  discard block
 block discarded – undo
276 273
           '#style_name' => $widget_settings['preview_image_style'],
277 274
           '#uri' => $uri,
278 275
         ];
279
-      }
280
-      else {
276
+      } else {
281 277
         $display = $this->entityTypeManager->getViewBuilder('file')->view($entity, $view_mode);
282 278
       }
283 279
 
@@ -292,8 +288,7 @@  discard block
 block discarded – undo
292 288
           if ($field_type == 'file') {
293 289
             $description = $item->description;
294 290
             $display_field = $item->display;
295
-          }
296
-          elseif ($field_type == 'image') {
291
+          } elseif ($field_type == 'image') {
297 292
             $alt = $item->alt;
298 293
             $title = $item->title;
299 294
           }
@@ -453,8 +448,7 @@  discard block
 block discarded – undo
453 448
       $extensions = isset($settings['file_extensions']) ? $settings['file_extensions'] : implode(' ', $supported_extensions);
454 449
       $extensions = array_intersect(explode(' ', $extensions), $supported_extensions);
455 450
       $validators['file_validate_extensions'] = [implode(' ', $extensions)];
456
-    }
457
-    elseif (!empty($settings['file_extensions'])) {
451
+    } elseif (!empty($settings['file_extensions'])) {
458 452
       $validators['file_validate_extensions'] = [$settings['file_extensions']];
459 453
     }
460 454
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
     $delta = 0;
229 229
 
230
-    $order_class = $field_machine_name . '-delta-order';
230
+    $order_class = $field_machine_name.'-delta-order';
231 231
 
232 232
     $current = [
233 233
       '#type' => 'table',
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
       $current[$entity_id] = [
305 305
         '#attributes' => [
306 306
           'class' => ['draggable'],
307
-          'data-entity-id' => $entity->getEntityTypeId() . ':' . $entity_id,
307
+          'data-entity-id' => $entity->getEntityTypeId().':'.$entity_id,
308 308
         ],
309 309
         'display' => $display,
310 310
         'filename' => ['#markup' => $entity->label()],
@@ -361,9 +361,9 @@  discard block
 block discarded – undo
361 361
             'wrapper' => $details_id,
362 362
           ],
363 363
           '#submit' => [[get_class($this), 'removeItemSubmit']],
364
-          '#name' => $field_machine_name . '_remove_' . $entity_id,
364
+          '#name' => $field_machine_name.'_remove_'.$entity_id,
365 365
           '#limit_validation_errors' => [array_merge($field_parents, [$field_machine_name, 'target_id'])],
366
-          '#attributes' => ['data-entity-id' => $entity->getEntityTypeId() . ':' . $entity_id],
366
+          '#attributes' => ['data-entity-id' => $entity->getEntityTypeId().':'.$entity_id],
367 367
           '#access' => (bool) $widget_settings['field_widget_remove'],
368 368
         ],
369 369
         '_weight' => [
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
     }
418 418
 
419 419
     // Return ourself as the structure doesn't match the default.
420
-    usort($return, function ($a, $b) {
420
+    usort($return, function($a, $b) {
421 421
       return SortArray::sortByKeyInt($a, $b, '_weight');
422 422
     });
423 423
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
     $data['validators']['file'] = ['validators' => $this->getFileValidators()];
478 478
     // Provide context for widgets to enhance their configuration. Currently
479 479
     // we only know that "upload_location" is used.
480
-    $data['widget_context']['upload_location'] = $settings['uri_scheme'] . '://' . $settings['file_directory'];
480
+    $data['widget_context']['upload_location'] = $settings['uri_scheme'].'://'.$settings['file_directory'];
481 481
     return $data;
482 482
   }
483 483
 
Please login to merge, or discard this patch.
src/Element/EntityBrowserElement.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
     }
64 64
 
65 65
     $default_value = implode(' ', array_map(
66
-      function (EntityInterface $item) {
67
-        return $item->getEntityTypeId() . ':' . $item->id();
66
+      function(EntityInterface $item) {
67
+        return $item->getEntityTypeId().':'.$item->id();
68 68
       },
69 69
       $element['#default_value']
70 70
     ));
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
       ['validators' => $validators, 'selected_entities' => $element['#default_value']]
86 86
     );
87 87
 
88
-    $hidden_id = Html::getUniqueId($element['#id'] . '-target');
88
+    $hidden_id = Html::getUniqueId($element['#id'].'-target');
89 89
     $element['entity_ids'] = [
90 90
       '#type' => 'hidden',
91 91
       '#id' => $hidden_id,
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     $element['#attached']['drupalSettings']['entity_browser'] = [
98 98
       $entity_browser->getDisplay()->getUuid() => [
99 99
         'cardinality' => $element['#cardinality'],
100
-        'selector' => '#' . $hidden_id,
100
+        'selector' => '#'.$hidden_id,
101 101
       ],
102 102
     ];
103 103
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     }
138 138
 
139 139
     return array_map(
140
-      function ($item) {
140
+      function($item) {
141 141
         list($entity_type, $entity_id) = explode(':', $item);
142 142
         return \Drupal::entityTypeManager()->getStorage($entity_type)->load($entity_id);
143 143
       },
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,8 +116,7 @@
 block discarded – undo
116 116
 
117 117
     if (!$this->isSelectionCompleted($form_state)) {
118 118
       $form_state->setRebuild();
119
-    }
120
-    else {
119
+    } else {
121 120
       $entity_browser->getDisplay()->selectionCompleted($this->getSelectedEntities($form_state));
122 121
     }
123 122
   }
Please login to merge, or discard this patch.
src/Tests/FormElementTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -51,22 +51,22 @@
 block discarded – undo
51 51
     $this->assertFieldByXPath("//input[@type='hidden' and @id='edit-fancy-entity-browser-target']", '', "Entity browser's hidden element found.");
52 52
 
53 53
     $edit = [
54
-      'fancy_entity_browser[entity_ids]' => $this->nodes[0]->getEntityTypeId() . ':' . $this->nodes[0]->id() . ' ' . $this->nodes[1]->getEntityTypeId() . ':' . $this->nodes[1]->id(),
54
+      'fancy_entity_browser[entity_ids]' => $this->nodes[0]->getEntityTypeId().':'.$this->nodes[0]->id().' '.$this->nodes[1]->getEntityTypeId().':'.$this->nodes[1]->id(),
55 55
     ];
56 56
     $this->drupalPostForm(NULL, $edit, 'Submit');
57
-    $expected = 'Selected entities: ' . $this->nodes[0]->label() . ', ' . $this->nodes[1]->label();
57
+    $expected = 'Selected entities: '.$this->nodes[0]->label().', '.$this->nodes[1]->label();
58 58
     $this->assertText($expected, 'Selected entities detected.');
59 59
 
60
-    $default_entity = $this->nodes[0]->getEntityTypeId() . ':' . $this->nodes[0]->id();
60
+    $default_entity = $this->nodes[0]->getEntityTypeId().':'.$this->nodes[0]->id();
61 61
     $this->drupalGet('/test-element', ['query' => ['default_entity' => $default_entity]]);
62 62
     $this->assertLink('Select entities', 0, 'Trigger link found.');
63 63
     $this->assertFieldByXPath("//input[@type='hidden' and @id='edit-fancy-entity-browser-target']", $default_entity, "Entity browser's hidden element found.");
64 64
 
65 65
     $edit = [
66
-      'fancy_entity_browser[entity_ids]' => $this->nodes[1]->getEntityTypeId() . ':' . $this->nodes[1]->id() . ' ' . $this->nodes[0]->getEntityTypeId() . ':' . $this->nodes[0]->id(),
66
+      'fancy_entity_browser[entity_ids]' => $this->nodes[1]->getEntityTypeId().':'.$this->nodes[1]->id().' '.$this->nodes[0]->getEntityTypeId().':'.$this->nodes[0]->id(),
67 67
     ];
68 68
     $this->drupalPostForm(NULL, $edit, 'Submit');
69
-    $expected = 'Selected entities: ' . $this->nodes[1]->label() . ', ' . $this->nodes[0]->label();
69
+    $expected = 'Selected entities: '.$this->nodes[1]->label().', '.$this->nodes[0]->label();
70 70
     $this->assertText($expected, 'Selected entities detected.');
71 71
   }
72 72
 
Please login to merge, or discard this patch.
src/WidgetBase.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -276,7 +276,7 @@
 block discarded – undo
276 276
   /**
277 277
    * Run widget validators.
278 278
    *
279
-   * @param array $entities
279
+   * @param \Drupal\Core\Entity\EntityInterface[] $entities
280 280
    *   Array of entity ids to validate.
281 281
    * @param array $validators
282 282
    *   Array of widget validator ids.
Please login to merge, or discard this patch.
src/Tests/ConfigUITest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
     $xpath = new \DOMXPath($dom);
140 140
     foreach ($commands as $command) {
141 141
       if ($command['command'] == 'insert' && $command['method'] == 'replaceWith') {
142
-        $wrapperNode = $xpath->query('//*[@id="' . ltrim($command['selector'], '#') . '"]')->item(0);
142
+        $wrapperNode = $xpath->query('//*[@id="'.ltrim($command['selector'], '#').'"]')->item(0);
143 143
         $newDom = new \DOMDocument();
144
-        @$newDom->loadHTML('<div>' . $command['data'] . '</div>');
144
+        @$newDom->loadHTML('<div>'.$command['data'].'</div>');
145 145
         $newNode = @$dom->importNode($newDom->documentElement->firstChild->firstChild, TRUE);
146 146
         $wrapperNode->parentNode->replaceChild($newNode, $wrapperNode);
147 147
         $content = $dom->saveHTML();
@@ -232,14 +232,14 @@  discard block
 block discarded – undo
232 232
     $this->assertUrl('/admin/config/content/entity_browser/test_entity_browser/selection_display', ['query' => ['js' => 'nojs']]);
233 233
 
234 234
     $this->drupalPostForm(NULL, [], 'Next');
235
-    $this->assertFieldById('edit-table-' . $first_uuid . '-label', 'upload', 'Correct value for widget label found.');
236
-    $this->assertFieldById('edit-table-' . $first_uuid . '-form-upload-location', 'public://', 'Correct value for upload location found.');
237
-    $this->assertFieldByXPath("//input[@data-drupal-selector='edit-table-" . $first_uuid . "-form-submit-text']", 'Select files', 'Correct value for submit text found.');
238
-    $this->assertFieldById('edit-table-' . $second_uuid . '-label', 'entity_form', 'Correct value for widget label found.');
239
-    $this->assertOptionSelectedWithDrupalSelector('edit-table-' . $second_uuid . '-form-entity-type', 'user', 'Correct value for entity type found.');
240
-    $this->assertOptionSelectedWithDrupalSelector('edit-table-' . $second_uuid . '-form-bundle-select', 'user', 'Correct value for bundle found.');
241
-    $this->assertOptionSelectedWithDrupalSelector('edit-table-' . $second_uuid . '-form-form-mode-form-select', 'register', 'Correct value for form modes found.');
242
-    $this->assertFieldByXPath("//input[@data-drupal-selector='edit-table-" . $second_uuid . "-form-submit-text']", 'But some are more equal than others', 'Correct value for submit text found.');
235
+    $this->assertFieldById('edit-table-'.$first_uuid.'-label', 'upload', 'Correct value for widget label found.');
236
+    $this->assertFieldById('edit-table-'.$first_uuid.'-form-upload-location', 'public://', 'Correct value for upload location found.');
237
+    $this->assertFieldByXPath("//input[@data-drupal-selector='edit-table-".$first_uuid."-form-submit-text']", 'Select files', 'Correct value for submit text found.');
238
+    $this->assertFieldById('edit-table-'.$second_uuid.'-label', 'entity_form', 'Correct value for widget label found.');
239
+    $this->assertOptionSelectedWithDrupalSelector('edit-table-'.$second_uuid.'-form-entity-type', 'user', 'Correct value for entity type found.');
240
+    $this->assertOptionSelectedWithDrupalSelector('edit-table-'.$second_uuid.'-form-bundle-select', 'user', 'Correct value for bundle found.');
241
+    $this->assertOptionSelectedWithDrupalSelector('edit-table-'.$second_uuid.'-form-form-mode-form-select', 'register', 'Correct value for form modes found.');
242
+    $this->assertFieldByXPath("//input[@data-drupal-selector='edit-table-".$second_uuid."-form-submit-text']", 'But some are more equal than others', 'Correct value for submit text found.');
243 243
 
244 244
     $this->drupalPostForm(NULL, [], 'Finish');
245 245
 
Please login to merge, or discard this patch.