Completed
Push — 8.x-1.x ( ca1f2a...63e4d3 )
by Janez
02:48
created
src/Plugin/EntityBrowser/SelectionDisplay/MultiStepDisplay.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $display = ['#markup' => $display];
114 114
       }
115 115
 
116
-      $form['selected']['items_' . $entity->id() . '_' . $id] = [
116
+      $form['selected']['items_'.$entity->id().'_'.$id] = [
117 117
         '#theme_wrappers' => ['container'],
118 118
         '#attributes' => [
119 119
           'class' => ['item-container'],
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
           '#type' => 'submit',
125 125
           '#value' => $this->t('Remove'),
126 126
           '#submit' => [[get_class($this), 'removeItemSubmit']],
127
-          '#name' => 'remove_' . $entity->id() . '_' . $id,
127
+          '#name' => 'remove_'.$entity->id().'_'.$id,
128 128
           '#attributes' => [
129 129
             'class' => ['entity-browser-remove-selected-entity'],
130 130
             'data-row-id' => $id,
131
-            'data-remove-entity' => 'items_' . $entity->id(),
131
+            'data-remove-entity' => 'items_'.$entity->id(),
132 132
           ],
133 133
         ],
134 134
         'weight' => [
@@ -290,10 +290,10 @@  discard block
 block discarded – undo
290 290
         foreach ($entity_ids as $entity_pair_info) {
291 291
           $last_entity_id = $selected_entities[$selected_entity_keys[$key_index]]->id();
292 292
 
293
-          $html = $renderer->render($form['selection_display']['selected']['items_' . $last_entity_id . '_' . $selected_entity_keys[$key_index]]);
293
+          $html = $renderer->render($form['selection_display']['selected']['items_'.$last_entity_id.'_'.$selected_entity_keys[$key_index]]);
294 294
 
295 295
           $ajax->addCommand(
296
-            new ReplaceCommand('div[id="' . $entity_pair_info['proxy_id'] . '"]', static::trimSingleHtmlTag($html))
296
+            new ReplaceCommand('div[id="'.$entity_pair_info['proxy_id'].'"]', static::trimSingleHtmlTag($html))
297 297
           );
298 298
 
299 299
           $key_index++;
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
     // Remove weight of entity being removed.
368 368
     $form_state->unsetValue([
369 369
       'selected',
370
-      $triggering_element['#attributes']['data-remove-entity'] . '_' . $triggering_element['#attributes']['data-row-id'],
370
+      $triggering_element['#attributes']['data-remove-entity'].'_'.$triggering_element['#attributes']['data-row-id'],
371 371
     ]);
372 372
 
373 373
     // Remove entity itself.
Please login to merge, or discard this patch.
src/Tests/ConfigUITest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
     $xpath = new \DOMXPath($dom);
147 147
     foreach ($commands as $command) {
148 148
       if ($command['command'] == 'insert' && $command['method'] == 'replaceWith') {
149
-        $wrapperNode = $xpath->query('//*[@id="' . ltrim($command['selector'], '#') . '"]')->item(0);
149
+        $wrapperNode = $xpath->query('//*[@id="'.ltrim($command['selector'], '#').'"]')->item(0);
150 150
         $newDom = new \DOMDocument();
151
-        @$newDom->loadHTML('<div>' . $command['data'] . '</div>');
151
+        @$newDom->loadHTML('<div>'.$command['data'].'</div>');
152 152
         $newNode = @$dom->importNode($newDom->documentElement->firstChild->firstChild, TRUE);
153 153
         $wrapperNode->parentNode->replaceChild($newNode, $wrapperNode);
154 154
         $content = $dom->saveHTML();
@@ -239,20 +239,20 @@  discard block
 block discarded – undo
239 239
     $this->assertUrl('/admin/config/content/entity_browser/test_entity_browser/selection_display', ['query' => ['js' => 'nojs']]);
240 240
 
241 241
     $this->drupalPostForm(NULL, [], 'Next');
242
-    $this->assertFieldById('edit-table-' . $first_uuid . '-label', 'upload', 'Correct value for widget label found.');
243
-    $this->assertFieldChecked('edit-table-' . $first_uuid . '-form-multiple', 'Accept multiple files option is enabled by default.');
242
+    $this->assertFieldById('edit-table-'.$first_uuid.'-label', 'upload', 'Correct value for widget label found.');
243
+    $this->assertFieldChecked('edit-table-'.$first_uuid.'-form-multiple', 'Accept multiple files option is enabled by default.');
244 244
     $this->assertText('Multiple uploads will only be accepted if the source field allows more than one value.');
245
-    $this->assertFieldById('edit-table-' . $first_uuid . '-form-upload-location', 'public://', 'Correct value for upload location found.');
246
-    $this->assertFieldByXPath("//input[@data-drupal-selector='edit-table-" . $first_uuid . "-form-submit-text']", 'Select files', 'Correct value for submit text found.');
247
-    $this->assertFieldById('edit-table-' . $second_uuid . '-label', 'entity_form', 'Correct value for widget label found.');
248
-    $this->assertOptionSelectedWithDrupalSelector('edit-table-' . $second_uuid . '-form-entity-type', 'user', 'Correct value for entity type found.');
249
-    $this->assertOptionSelectedWithDrupalSelector('edit-table-' . $second_uuid . '-form-bundle-select', 'user', 'Correct value for bundle found.');
250
-    $this->assertOptionSelectedWithDrupalSelector('edit-table-' . $second_uuid . '-form-form-mode-form-select', 'register', 'Correct value for form modes found.');
251
-    $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.');
245
+    $this->assertFieldById('edit-table-'.$first_uuid.'-form-upload-location', 'public://', 'Correct value for upload location found.');
246
+    $this->assertFieldByXPath("//input[@data-drupal-selector='edit-table-".$first_uuid."-form-submit-text']", 'Select files', 'Correct value for submit text found.');
247
+    $this->assertFieldById('edit-table-'.$second_uuid.'-label', 'entity_form', 'Correct value for widget label found.');
248
+    $this->assertOptionSelectedWithDrupalSelector('edit-table-'.$second_uuid.'-form-entity-type', 'user', 'Correct value for entity type found.');
249
+    $this->assertOptionSelectedWithDrupalSelector('edit-table-'.$second_uuid.'-form-bundle-select', 'user', 'Correct value for bundle found.');
250
+    $this->assertOptionSelectedWithDrupalSelector('edit-table-'.$second_uuid.'-form-form-mode-form-select', 'register', 'Correct value for form modes found.');
251
+    $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.');
252 252
 
253
-    $this->drupalPostForm(NULL, ['table[' . $first_uuid . '][form][multiple]' => FALSE], 'Finish');
253
+    $this->drupalPostForm(NULL, ['table['.$first_uuid.'][form][multiple]' => FALSE], 'Finish');
254 254
     $this->drupalGet('/admin/config/content/entity_browser/test_entity_browser/widgets');
255
-    $this->assertNoFieldChecked('edit-table-' . $first_uuid . '-form-multiple', 'Accept multiple files option is disabled.');
255
+    $this->assertNoFieldChecked('edit-table-'.$first_uuid.'-form-multiple', 'Accept multiple files option is disabled.');
256 256
 
257 257
     $this->drupalLogout();
258 258
     $this->drupalGet('/admin/config/content/entity_browser/test_entity_browser');
Please login to merge, or discard this patch.