Completed
Pull Request — 8.x-1.x (#144)
by
unknown
02:33
created
src/Plugin/EntityBrowser/SelectionDisplay/MultiStepDisplay.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
       '#tree' => TRUE
35 35
     ];
36 36
     foreach ($selected_entities as $id => $entity) {
37
-      $form['selected']['items_'. $entity->id()] = [
37
+      $form['selected']['items_'.$entity->id()] = [
38 38
         '#theme_wrappers' => ['container'],
39 39
         '#attributes' => [
40 40
           'class' => ['selected-item-container'],
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
           '#type' => 'submit',
46 46
           '#value' => $this->t('Remove'),
47 47
           '#submit' => [[get_class($this), 'removeItemSubmit']],
48
-          '#name' => 'remove_' . $entity->id(),
48
+          '#name' => 'remove_'.$entity->id(),
49 49
           '#attributes' => [
50 50
             'data-row-id' => $id,
51
-            'data-remove-entity' => 'items_' . $entity->id(),
51
+            'data-remove-entity' => 'items_'.$entity->id(),
52 52
           ]
53 53
         ],
54 54
         'weight' => [
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Drupal\entity_browser\Plugin\EntityBrowser\SelectionDisplay;
4 4
 
5
-use Drupal\Component\Utility\Html;
6 5
 use Drupal\Core\Entity\EntityManagerInterface;
7 6
 use Drupal\Core\Form\FormStateInterface;
8 7
 use Drupal\entity_browser\FieldWidgetDisplayManager;
Please login to merge, or discard this patch.
entity_browser.module 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 /**
43 43
  * Implements hook_form_alter().
44 44
  */
45
-function entity_browser_form_alter(&$form, FormStateInterface &$form_state) {
45
+function entity_browser_form_alter(&$form, FormStateInterface&$form_state) {
46 46
   $entity_browser_dialog_edit = \Drupal::service('request_stack')->getCurrentRequest()->get('_route');
47 47
   if ($entity_browser_dialog_edit == 'entity_browser.edit_form') {
48 48
     // Let's allow the save button only.
Please login to merge, or discard this patch.
modules/entity_form/entity_browser_entity_form.module 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 /**
8 8
  * Implements hook_inline_entity_form_reference_form_alter().
9 9
  */
10
-function entity_browser_entity_form_inline_entity_form_reference_form_alter(&$reference_form, \Drupal\Core\Form\FormStateInterface &$form_state) {
10
+function entity_browser_entity_form_inline_entity_form_reference_form_alter(&$reference_form, \Drupal\Core\Form\FormStateInterface&$form_state) {
11 11
   $entity_manager = \Drupal::entityManager();
12 12
   \Drupal::service('event_dispatcher')
13 13
     ->addListener(
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
   $instance = $form_state->get(['inline_entity_form', $reference_form['#ief_id'], 'instance']);
20 20
 
21 21
   /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display */
22
-  $entity_form_id = $instance->getTargetEntityTypeId() . '.' . $instance->getTargetBundle() . '.default';
22
+  $entity_form_id = $instance->getTargetEntityTypeId().'.'.$instance->getTargetBundle().'.default';
23 23
   // TODO - 'default' might become configurable or something else in the future.
24 24
   // See https://www.drupal.org/node/2510274
25 25
   $form_display = $entity_manager->getStorage('entity_form_display')->load($entity_form_id);
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
     foreach ($attach_entities as $attach_entity) {
98 98
       foreach ($form_state->get(['inline_entity_form', $ief_id, 'entities']) as $key => $value) {
99 99
         if ($value['entity'] == $attach_entity) {
100
-          $form_state->setErrorByName($parents_path . '][existing_entity', t('The selected @label has already been added.', array('@label' => $labels['singular'])));
100
+          $form_state->setErrorByName($parents_path.'][existing_entity', t('The selected @label has already been added.', array('@label' => $labels['singular'])));
101 101
         }
102 102
       }
103 103
     }
104 104
   }
105 105
   else {
106
-    $form_state->setErrorByName($parents_path . '][existing_entity', t('The selected @label is not valid.', array('@label' => $labels['singular'])));
106
+    $form_state->setErrorByName($parents_path.'][existing_entity', t('The selected @label is not valid.', array('@label' => $labels['singular'])));
107 107
   }
108 108
 }
109 109
 
@@ -133,14 +133,14 @@  discard block
 block discarded – undo
133 133
   if ($form_state->has(['inline_entity_form', $ief_id, 'entities', 0])) {
134 134
     $weight = max(
135 135
         array_map(
136
-          function ($item) { return intval($item['_weight']); },
136
+          function($item) { return intval($item['_weight']); },
137 137
           $form_state->get(['inline_entity_form', $ief_id, 'entities'])
138 138
         )
139 139
       );
140 140
     $weight++;
141 141
   }
142 142
 
143
-  $entities =& $form_state->get(['inline_entity_form', $ief_id, 'entities']);
143
+  $entities = & $form_state->get(['inline_entity_form', $ief_id, 'entities']);
144 144
   foreach ($attach_entities as $attach_entity) {
145 145
     $entities[] = array(
146 146
       'entity' => $attach_entity,
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,8 +101,7 @@
 block discarded – undo
101 101
         }
102 102
       }
103 103
     }
104
-  }
105
-  else {
104
+  } else {
106 105
     $form_state->setErrorByName($parents_path . '][existing_entity', t('The selected @label is not valid.', array('@label' => $labels['singular'])));
107 106
   }
108 107
 }
Please login to merge, or discard this patch.
src/Plugin/EntityBrowser/Display/IFrame.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -221,8 +221,8 @@
 block discarded – undo
221 221
   }
222 222
 
223 223
   /**
224
-    * {@inheritdoc}
225
-    */
224
+   * {@inheritdoc}
225
+   */
226 226
   public function setUuid($uuid) {
227 227
     $this->uuid = $uuid;
228 228
   }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             'entity_browser' => [
170 170
               'iframe' => [
171 171
                 $uuid => [
172
-                  'src' => Url::fromRoute('entity_browser.' . $this->configuration['entity_browser_id'], [], $data['query_parameters'])
172
+                  'src' => Url::fromRoute('entity_browser.'.$this->configuration['entity_browser_id'], [], $data['query_parameters'])
173 173
                     ->toString(),
174 174
                   'width' => $this->configuration['width'],
175 175
                   'height' => $this->configuration['height'],
@@ -203,13 +203,13 @@  discard block
 block discarded – undo
203 203
   public function propagateSelection(FilterResponseEvent $event) {
204 204
     $render = [
205 205
       'labels' => [
206
-        '#markup' => 'Labels: ' . implode(', ', array_map(function (EntityInterface $item) {return $item->label();}, $this->entities)),
206
+        '#markup' => 'Labels: '.implode(', ', array_map(function(EntityInterface $item) {return $item->label(); }, $this->entities)),
207 207
         '#attached' => [
208 208
           'library' => ['entity_browser/iframe_selection'],
209 209
           'drupalSettings' => [
210 210
             'entity_browser' => [
211 211
               'iframe' => [
212
-                'entities' => array_map(function (EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()];}, $this->entities),
212
+                'entities' => array_map(function(EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()]; }, $this->entities),
213 213
                 'uuid' => $this->request->query->get('uuid'),
214 214
               ],
215 215
             ],
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
    * {@inheritdoc}
243 243
    */
244 244
   public function path() {
245
-    return '/entity-browser/iframe/' . $this->configuration['entity_browser_id'];
245
+    return '/entity-browser/iframe/'.$this->configuration['entity_browser_id'];
246 246
   }
247 247
 
248 248
   /**
Please login to merge, or discard this patch.
modules/entity_form/src/Plugin/EntityBrowser/Widget/EntityForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     $definitions = $this->entityManager->getDefinitions();
66 66
     $entity_types = array_combine(
67 67
       array_keys($definitions),
68
-      array_map(function (EntityTypeInterface $item) { return $item->getLabel(); }, $definitions)
68
+      array_map(function(EntityTypeInterface $item) { return $item->getLabel(); }, $definitions)
69 69
     );
70 70
 
71 71
     $form['entity_type'] = [
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     $bundles = [];
83 83
     if ($entity_type) {
84 84
       $definitions = $this->entityManager->getBundleInfo($entity_type);
85
-      $bundles = array_map(function ($item) { return $item['label']; }, $definitions);
85
+      $bundles = array_map(function($item) { return $item['label']; }, $definitions);
86 86
     }
87 87
 
88 88
     $form['bundle'] = [
Please login to merge, or discard this patch.