Completed
Push — 8.x-1.x ( 200447...d6a817 )
by Janez
02:18
created
src/Form/EntityBrowserForm.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
    * {@inheritdoc}
65 65
    */
66 66
   public function getFormId() {
67
-    return 'entity_browser_' . $this->entityBrowser->id() . '_form';
67
+    return 'entity_browser_'.$this->entityBrowser->id().'_form';
68 68
   }
69 69
 
70 70
   /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,8 +86,7 @@  discard block
 block discarded – undo
86 86
     $form_state->set('entity_form_initialized', TRUE);
87 87
     if ($this->getRequest()->query->has('uuid')) {
88 88
       $form_state->set(['entity_browser', 'instance_uuid'], $this->getRequest()->query->get('uuid'));
89
-    }
90
-    else {
89
+    } else {
91 90
       $form_state->set(['entity_browser', 'instance_uuid'], $this->uuidGenerator->generate());
92 91
     }
93 92
     $form_state->set(['entity_browser', 'selected_entities'], []);
@@ -194,8 +193,7 @@  discard block
 block discarded – undo
194 193
 
195 194
     if (!$this->isSelectionCompleted($form_state)) {
196 195
       $form_state->setRebuild();
197
-    }
198
-    else {
196
+    } else {
199 197
       $this->entityBrowser->getDisplay()->selectionCompleted($this->getSelectedEntities($form_state));
200 198
     }
201 199
   }
Please login to merge, or discard this patch.
src/EntityBrowserInterface.php 1 patch
Doc Comments   -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,6 @@  discard block
 block discarded – undo
53 53
   /**
54 54
    * Sets the id of the widget selector plugin.
55 55
    *
56
-   * @param string $display
57
-   *   The id of the widget selector plugin.
58 56
    *
59 57
    * @return \Drupal\entity_browser\EntityBrowserInterface
60 58
    *   The class instance this method is called on.
@@ -64,8 +62,6 @@  discard block
 block discarded – undo
64 62
   /**
65 63
    * Sets the id of the selection display plugin.
66 64
    *
67
-   * @param string $display
68
-   *   The id of the selection display plugin.
69 65
    *
70 66
    * @return \Drupal\entity_browser\EntityBrowserInterface
71 67
    *   The class instance this method is called on.
Please login to merge, or discard this patch.
src/Entity/EntityBrowser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -385,7 +385,7 @@
 block discarded – undo
385 385
           '_title_callback' => 'Drupal\entity_browser\Controllers\EntityBrowserFormController::title',
386 386
           'entity_browser_id' => $this->id(),
387 387
         ],
388
-        ['_permission' => 'access ' . $this->id() . ' entity browser pages'],
388
+        ['_permission' => 'access '.$this->id().' entity browser pages'],
389 389
         ['_admin_route' => \Drupal::config('node.settings')->get('use_admin_theme')]
390 390
       );
391 391
     }
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
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
     }
151 151
 
152 152
     $default_value = implode(' ', array_map(
153
-      function (EntityInterface $item) {
154
-        return $item->getEntityTypeId() . ':' . $item->id();
153
+      function(EntityInterface $item) {
154
+        return $item->getEntityTypeId().':'.$item->id();
155 155
       },
156 156
       $entity_browser_preselected_entities
157 157
     ));
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
       ]
176 176
     );
177 177
 
178
-    $hidden_id = Html::getUniqueId($element['#id'] . '-target');
178
+    $hidden_id = Html::getUniqueId($element['#id'].'-target');
179 179
     $element['entity_ids'] = [
180 180
       '#type' => 'hidden',
181 181
       '#id' => $hidden_id,
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
       $entity_browser->getDisplay()->getUuid() => [
189 189
         'cardinality' => $element['#cardinality'],
190 190
         'selection_mode' => $element['#selection_mode'],
191
-        'selector' => '#' . $hidden_id,
191
+        'selector' => '#'.$hidden_id,
192 192
       ],
193 193
     ];
194 194
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     }
229 229
 
230 230
     return array_map(
231
-      function ($item) {
231
+      function($item) {
232 232
         list($entity_type, $entity_id) = explode(':', $item);
233 233
         return \Drupal::entityTypeManager()->getStorage($entity_type)->load($entity_id);
234 234
       },
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,8 +136,7 @@
 block discarded – undo
136 136
     /** @var \Drupal\entity_browser\EntityBrowserInterface $entity_browser */
137 137
     if (is_string($element['#entity_browser'])) {
138 138
       $entity_browser = EntityBrowser::load($element['#entity_browser']);
139
-    }
140
-    else {
139
+    } else {
141 140
       $entity_browser = $element['#entity_browser'];
142 141
     }
143 142
 
Please login to merge, or discard this patch.
src/Tests/EntityBrowserUITest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
     $file = File::load(1);
66 66
     // Test entity browser token that has upload location configured to
67 67
     // public://[current-user:account-name]/.
68
-    $this->assertEqual($file->getFileUri(), 'public://' . $account->getUsername() . '/' . $file->getFilename(), 'Image has the correct uri.');
68
+    $this->assertEqual($file->getFileUri(), 'public://'.$account->getUsername().'/'.$file->getFilename(), 'Image has the correct uri.');
69 69
   }
70 70
 
71 71
 }
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
@@ -52,22 +52,22 @@
 block discarded – undo
52 52
     $this->assertFieldByXPath("//input[@type='hidden' and @id='edit-fancy-entity-browser-target']", '', "Entity browser's hidden element found.");
53 53
 
54 54
     $edit = [
55
-      'fancy_entity_browser[entity_ids]' => $this->nodes[0]->getEntityTypeId() . ':' . $this->nodes[0]->id() . ' ' . $this->nodes[1]->getEntityTypeId() . ':' . $this->nodes[1]->id(),
55
+      'fancy_entity_browser[entity_ids]' => $this->nodes[0]->getEntityTypeId().':'.$this->nodes[0]->id().' '.$this->nodes[1]->getEntityTypeId().':'.$this->nodes[1]->id(),
56 56
     ];
57 57
     $this->drupalPostForm(NULL, $edit, 'Submit');
58
-    $expected = 'Selected entities: ' . $this->nodes[0]->label() . ', ' . $this->nodes[1]->label();
58
+    $expected = 'Selected entities: '.$this->nodes[0]->label().', '.$this->nodes[1]->label();
59 59
     $this->assertText($expected, 'Selected entities detected.');
60 60
 
61
-    $default_entity = $this->nodes[0]->getEntityTypeId() . ':' . $this->nodes[0]->id();
61
+    $default_entity = $this->nodes[0]->getEntityTypeId().':'.$this->nodes[0]->id();
62 62
     $this->drupalGet('/test-element', ['query' => ['default_entity' => $default_entity, 'selection_mode' => EntityBrowserElement::SELECTION_MODE_EDIT]]);
63 63
     $this->assertLink('Select entities', 0, 'Trigger link found.');
64 64
     $this->assertFieldByXPath("//input[@type='hidden' and @id='edit-fancy-entity-browser-target']", $default_entity, "Entity browser's hidden element found.");
65 65
 
66 66
     $edit = [
67
-      'fancy_entity_browser[entity_ids]' => $this->nodes[1]->getEntityTypeId() . ':' . $this->nodes[1]->id() . ' ' . $this->nodes[0]->getEntityTypeId() . ':' . $this->nodes[0]->id(),
67
+      'fancy_entity_browser[entity_ids]' => $this->nodes[1]->getEntityTypeId().':'.$this->nodes[1]->id().' '.$this->nodes[0]->getEntityTypeId().':'.$this->nodes[0]->id(),
68 68
     ];
69 69
     $this->drupalPostForm(NULL, $edit, 'Submit');
70
-    $expected = 'Selected entities: ' . $this->nodes[1]->label() . ', ' . $this->nodes[0]->label();
70
+    $expected = 'Selected entities: '.$this->nodes[1]->label().', '.$this->nodes[0]->label();
71 71
     $this->assertText($expected, 'Selected entities detected.');
72 72
   }
73 73
 
Please login to merge, or discard this patch.
src/Tests/EntityBrowserUpdateHookTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
    */
17 17
   protected function setDatabaseDumpFiles() {
18 18
     $this->databaseDumpFiles = [
19
-      DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
20
-      __DIR__ . '/../../tests/fixtures/update/entity_browser.update-hook-test.php',
19
+      DRUPAL_ROOT.'/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
20
+      __DIR__.'/../../tests/fixtures/update/entity_browser.update-hook-test.php',
21 21
     ];
22 22
   }
23 23
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
       ->get('entity_browser.browser.test_update');
54 54
 
55 55
     $this->assertNull($browser->get('submit_text'), 'Old submit text is gone');
56
-    $this->assertEqual($browser->get('widgets.a4ad947c-9669-497c-9988-24351955a02f.settings.submit_text'), 'All animals are created equal','New submit text appears on the widget.');
56
+    $this->assertEqual($browser->get('widgets.a4ad947c-9669-497c-9988-24351955a02f.settings.submit_text'), 'All animals are created equal', 'New submit text appears on the widget.');
57 57
   }
58 58
 
59 59
   /**
Please login to merge, or discard this patch.
src/Plugin/views/field/SelectForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@
 block discarded – undo
25 25
    */
26 26
   public function getRowId(ResultRow $row) {
27 27
     $entity = $this->getEntity($row);
28
-    return $entity->getEntityTypeId() . ':' . $entity->id();
28
+    return $entity->getEntityTypeId().':'.$entity->id();
29 29
   }
30 30
 
31 31
   /**
32 32
    * {@inheritdoc}
33 33
    */
34 34
   public function render(ResultRow $values) {
35
-    return ViewsRenderPipelineMarkup::create('<!--form-item-' . $this->options['id'] . '--' . $this->getRowId($values) . '-->');
35
+    return ViewsRenderPipelineMarkup::create('<!--form-item-'.$this->options['id'].'--'.$this->getRowId($values).'-->');
36 36
   }
37 37
 
38 38
   /**
Please login to merge, or discard this patch.
src/Plugin/views/display/EntityBrowser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
         $form_element_row_id = $select->getRowId($row);
147 147
 
148 148
         $substitutions[] = [
149
-          'placeholder' => '<!--form-item-entity_browser_select--' . $form_element_row_id . '-->',
149
+          'placeholder' => '<!--form-item-entity_browser_select--'.$form_element_row_id.'-->',
150 150
           'field_name' => 'entity_browser_select',
151 151
           'row_id' => $form_element_row_id,
152 152
         ];
Please login to merge, or discard this patch.