@@ -90,7 +90,7 @@ |
||
90 | 90 | $form_element_row_id = $row_id; |
91 | 91 | |
92 | 92 | $substitutions[] = [ |
93 | - 'placeholder' => '<!--form-item-entity_browser_select--' . $form_element_row_id . '-->', |
|
93 | + 'placeholder' => '<!--form-item-entity_browser_select--'.$form_element_row_id.'-->', |
|
94 | 94 | 'field_name' => 'entity_browser_select', |
95 | 95 | 'row_id' => $form_element_row_id, |
96 | 96 | ]; |
@@ -62,7 +62,7 @@ |
||
62 | 62 | /** @var $browser \Drupal\entity_browser\EntityBrowserInterface */ |
63 | 63 | $browser = $this->browserStorage->load($id); |
64 | 64 | if ($route = $browser->route()) { |
65 | - $collection->add('entity_browser.' . $browser->id(), $route); |
|
65 | + $collection->add('entity_browser.'.$browser->id(), $route); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | * @return array |
31 | 31 | * Form structure. |
32 | 32 | */ |
33 | - public function getForm(array &$form, FormStateInterface &$form_state); |
|
33 | + public function getForm(array &$form, FormStateInterface&$form_state); |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Sets the default widget. |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | // info. |
135 | 135 | $event_object = new RegisterJSCallbacks($this->configuration['entity_browser_id'], $uuid); |
136 | 136 | $event_object->registerCallback('Drupal.entityBrowser.selectionCompleted'); |
137 | - $event = $this->eventDispatcher->dispatch(Events::REGISTER_JS_CALLBACKS, $event_object ); |
|
137 | + $event = $this->eventDispatcher->dispatch(Events::REGISTER_JS_CALLBACKS, $event_object); |
|
138 | 138 | $original_path = $this->currentPath->getPath(); |
139 | 139 | return [ |
140 | 140 | '#theme_wrappers' => ['container'], |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | 'entity_browser' => [ |
155 | 155 | 'iframe' => [ |
156 | 156 | $uuid => [ |
157 | - 'src' => Url::fromRoute('entity_browser.' . $this->configuration['entity_browser_id'], [], [ |
|
157 | + 'src' => Url::fromRoute('entity_browser.'.$this->configuration['entity_browser_id'], [], [ |
|
158 | 158 | 'query' => [ |
159 | 159 | 'uuid' => $uuid, |
160 | 160 | 'original_path' => $original_path, |
@@ -192,13 +192,13 @@ discard block |
||
192 | 192 | public function propagateSelection(FilterResponseEvent $event) { |
193 | 193 | $render = [ |
194 | 194 | 'labels' => [ |
195 | - '#markup' => 'Labels: ' . implode(', ', array_map(function (EntityInterface $item) {return $item->label();}, $this->entities)), |
|
195 | + '#markup' => 'Labels: '.implode(', ', array_map(function(EntityInterface $item) {return $item->label(); }, $this->entities)), |
|
196 | 196 | '#attached' => [ |
197 | 197 | 'library' => ['entity_browser/iframe_selection'], |
198 | 198 | 'drupalSettings' => [ |
199 | 199 | 'entity_browser' => [ |
200 | 200 | 'iframe' => [ |
201 | - 'entities' => array_map(function (EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()];}, $this->entities), |
|
201 | + 'entities' => array_map(function(EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()]; }, $this->entities), |
|
202 | 202 | 'uuid' => $this->request->query->get('uuid'), |
203 | 203 | ], |
204 | 204 | ], |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | * {@inheritdoc} |
225 | 225 | */ |
226 | 226 | public function path() { |
227 | - return '/entity-browser/iframe/' . $this->configuration['entity_browser_id']; |
|
227 | + return '/entity-browser/iframe/'.$this->configuration['entity_browser_id']; |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | } |
@@ -116,8 +116,7 @@ |
||
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 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * {@inheritdoc} |
24 | 24 | */ |
25 | 25 | public function render(ResultRow $values) { |
26 | - return ViewsRenderPipelineMarkup::create('<!--form-item-' . $this->options['id'] . '--' . $values->index . '-->'); |
|
26 | + return ViewsRenderPipelineMarkup::create('<!--form-item-'.$this->options['id'].'--'.$values->index.'-->'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | '#type' => 'checkbox', |
63 | 63 | '#title' => $this->t('Select this item'), |
64 | 64 | '#title_display' => 'invisible', |
65 | - '#return_value' => $entity->getEntityTypeId() . ':' . $entity->id(), |
|
65 | + '#return_value' => $entity->getEntityTypeId().':'.$entity->id(), |
|
66 | 66 | '#attributes' => ['name' => "entity_browser_select[$row_index]"], |
67 | 67 | '#default_value' => NULL, |
68 | 68 | ]; |
@@ -8,10 +8,7 @@ |
||
8 | 8 | |
9 | 9 | use Drupal\Component\Utility\NestedArray; |
10 | 10 | use Drupal\Core\Form\FormStateInterface; |
11 | -use Drupal\Core\TypedData\DataDefinition; |
|
12 | -use Drupal\Core\TypedData\TypedData; |
|
13 | 11 | use Drupal\entity_browser\WidgetBase; |
14 | -use Drupal\file\Plugin\Field\FieldType\FileItem; |
|
15 | 12 | |
16 | 13 | /** |
17 | 14 | * Uses a view to provide entity listing in a browser's widget. |
@@ -56,7 +56,7 @@ |
||
56 | 56 | $uploaded_files = $form_state->getValue(['upload'], []); |
57 | 57 | $trigger = $form_state->getTriggeringElement(); |
58 | 58 | |
59 | - if (in_array('submit', $trigger['#array_parents'] )) { |
|
59 | + if (in_array('submit', $trigger['#array_parents'])) { |
|
60 | 60 | $violations = $this->runWidgetValidators($uploaded_files); |
61 | 61 | if (count($violations !== 0)) { |
62 | 62 | /** @var \Symfony\Component\Validator\ConstraintViolationListInterface $violation */ |