@@ -53,8 +53,6 @@ discard block |
||
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 |
||
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. |
@@ -385,7 +385,7 @@ |
||
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 | } |
@@ -136,8 +136,7 @@ |
||
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 |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | $default_value = implode(' ', array_map( |
157 | - function (EntityInterface $item) { |
|
158 | - return $item->getEntityTypeId() . ':' . $item->id(); |
|
157 | + function(EntityInterface $item) { |
|
158 | + return $item->getEntityTypeId().':'.$item->id(); |
|
159 | 159 | }, |
160 | 160 | $entity_browser_preselected_entities |
161 | 161 | )); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | ] |
190 | 190 | ); |
191 | 191 | |
192 | - $hidden_id = Html::getUniqueId($element['#id'] . '-target'); |
|
192 | + $hidden_id = Html::getUniqueId($element['#id'].'-target'); |
|
193 | 193 | $element['entity_ids'] = [ |
194 | 194 | '#type' => 'hidden', |
195 | 195 | '#id' => $hidden_id, |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $entity_browser->getDisplay()->getUuid() => [ |
203 | 203 | 'cardinality' => $element['#cardinality'], |
204 | 204 | 'selection_mode' => $element['#selection_mode'], |
205 | - 'selector' => '#' . $hidden_id, |
|
205 | + 'selector' => '#'.$hidden_id, |
|
206 | 206 | ], |
207 | 207 | ]; |
208 | 208 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | return array_map( |
246 | - function ($item) { |
|
246 | + function($item) { |
|
247 | 247 | list($entity_type, $entity_id) = explode(':', $item); |
248 | 248 | return \Drupal::entityTypeManager()->getStorage($entity_type)->load($entity_id); |
249 | 249 | }, |
@@ -65,7 +65,7 @@ |
||
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 | } |
@@ -52,22 +52,22 @@ |
||
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 |
@@ -16,8 +16,8 @@ discard block |
||
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 |
||
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 | /** |
@@ -25,14 +25,14 @@ |
||
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 | /** |
@@ -146,7 +146,7 @@ |
||
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 | ]; |
@@ -54,8 +54,7 @@ |
||
54 | 54 | // that directly. |
55 | 55 | if ($option == 'use_ajax') { |
56 | 56 | return TRUE; |
57 | - } |
|
58 | - else { |
|
57 | + } else { |
|
59 | 58 | return parent::getOption($option); |
60 | 59 | } |
61 | 60 | } |
@@ -238,13 +238,13 @@ |
||
238 | 238 | foreach ($displays as $display) { |
239 | 239 | list($view_id, $display_id) = $display; |
240 | 240 | $view = $this->entityTypeManager->getStorage('view')->load($view_id); |
241 | - $options[$view_id . '.' . $display_id] = $this->t('@view : @display', array('@view' => $view->label(), '@display' => $view->get('display')[$display_id]['display_title'])); |
|
241 | + $options[$view_id.'.'.$display_id] = $this->t('@view : @display', array('@view' => $view->label(), '@display' => $view->get('display')[$display_id]['display_title'])); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | $form['view'] = [ |
245 | 245 | '#type' => 'select', |
246 | 246 | '#title' => $this->t('View : View display'), |
247 | - '#default_value' => $this->configuration['view'] . '.' . $this->configuration['view_display'], |
|
247 | + '#default_value' => $this->configuration['view'].'.'.$this->configuration['view_display'], |
|
248 | 248 | '#options' => $options, |
249 | 249 | '#empty_option' => $this->t('- Select a view -'), |
250 | 250 | '#required' => TRUE, |
@@ -125,8 +125,7 @@ discard block |
||
125 | 125 | return [ |
126 | 126 | '#markup' => $this->t('Entity browser select form field not found on a view. <a href=":link">Go fix it</a>!', [':link' => $url]), |
127 | 127 | ]; |
128 | - } |
|
129 | - else { |
|
128 | + } else { |
|
130 | 129 | return [ |
131 | 130 | '#markup' => $this->t('Entity browser select form field not found on a view. Go fix it!'), |
132 | 131 | ]; |
@@ -184,8 +183,7 @@ discard block |
||
184 | 183 | ]); |
185 | 184 | $form_state->setError($form['widget']['view']['entity_browser_select'], $message); |
186 | 185 | } |
187 | - } |
|
188 | - catch (PluginNotFoundException $e) { |
|
186 | + } catch (PluginNotFoundException $e) { |
|
189 | 187 | $message = $this->t('The Entity Type @type does not exist.', [ |
190 | 188 | '@type' => $parts[0], |
191 | 189 | ]); |