Completed
Pull Request — 8.x-1.x (#127)
by Janez
07:37
created
src/Entity/EntityBrowser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -336,7 +336,7 @@
 block discarded – undo
336 336
           '_title_callback' => 'Drupal\entity_browser\Controllers\StandalonePage::title',
337 337
           'entity_browser_id' => $this->id(),
338 338
         ],
339
-        ['_permission' => 'access ' . $this->id() . ' entity browser pages'],
339
+        ['_permission' => 'access '.$this->id().' entity browser pages'],
340 340
         ['_admin_route' => \Drupal::config('node.settings')->get('use_admin_theme')]
341 341
       );
342 342
     }
Please login to merge, or discard this patch.
src/Permissions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 
64 64
     foreach ($browsers as $browser) {
65 65
       if ($browser->route()) {
66
-        $permissions['access ' . $browser->id() . ' entity browser pages'] = array(
66
+        $permissions['access '.$browser->id().' entity browser pages'] = array(
67 67
           'title' => $this->translationManager->translate('Access @name pages', array('@name' => $browser->label())),
68 68
           'description' => $this->translationManager->translate('Access pages that %browser uses to operate.', array('%browser' => $browser->label())),
69 69
         );
Please login to merge, or discard this patch.
src/Plugin/EntityBrowser/SelectionDisplay/View.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
     // them only once. Reason for that is how SQL and Views work and we probably
52 52
     // can't do much about it.
53 53
     if (!empty($this->selectedEntities)) {
54
-      $ids = array_map(function(EntityInterface $item) {return $item->id();}, $this->selectedEntities);
54
+      $ids = array_map(function(EntityInterface $item) {return $item->id(); }, $this->selectedEntities);
55 55
       $storage['selection_display_view']->setArguments([implode(',', $ids)]);
56 56
     }
57 57
 
Please login to merge, or discard this patch.
src/Plugin/EntityBrowser/Widget/Upload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
     $uploaded_files = $form_state->getValue(['upload'], []);
54 54
     $trigger = $form_state->getTriggeringElement();
55 55
     // Only validate if we are uploading a file.
56
-    if (empty($uploaded_files)  && $trigger['#value'] == 'Upload') {
56
+    if (empty($uploaded_files) && $trigger['#value'] == 'Upload') {
57 57
       $form_state->setError($form['widget']['upload'], t('At least one file should be uploaded.'));
58 58
     }
59 59
   }
Please login to merge, or discard this patch.
src/Plugin/EntityBrowser/Widget/View.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@
 block discarded – undo
126 126
     $form_state->set('view_widget_rows', $ids);
127 127
 
128 128
     if (empty($view->field['entity_browser_select'])) {
129
-      $url = Url::fromRoute('entity.view.edit_form',['view'=>$this->configuration['view']])->toString();
129
+      $url = Url::fromRoute('entity.view.edit_form', ['view'=>$this->configuration['view']])->toString();
130 130
       if ($this->currentUser->hasPermission('administer views')) {
131 131
         return [
132 132
           '#markup' => t('Entity browser select form field not found on a view. <a href=":link">Go fix it</a>!', [':link' => $url]),
Please login to merge, or discard this patch.
src/Plugin/EntityBrowser/WidgetSelector/DropDown.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
   /**
25 25
    * {@inheritdoc}
26 26
    */
27
-  public function getForm(array &$form = array(), FormStateInterface &$form_state = NULL) {
27
+  public function getForm(array &$form = array(), FormStateInterface&$form_state = NULL) {
28 28
     // Set a wrapper container for us to replace the form on ajax call.
29 29
     $form['#prefix'] = '<div id="entity-browser-form">';
30 30
     $form['#suffix'] = '</div>';
Please login to merge, or discard this patch.
src/Plugin/EntityBrowser/WidgetSelector/Single.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
   /**
25 25
    * {@inheritdoc}
26 26
    */
27
-  public function getForm(array &$form, FormStateInterface &$form_state) {
27
+  public function getForm(array &$form, FormStateInterface&$form_state) {
28 28
     return array();
29 29
   }
30 30
 
Please login to merge, or discard this patch.
src/Plugin/EntityBrowser/WidgetSelector/Tabs.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@
 block discarded – undo
24 24
   /**
25 25
    * {@inheritdoc}
26 26
    */
27
-  public function getForm(array &$form = array(), FormStateInterface &$form_state = NULL) {
27
+  public function getForm(array &$form = array(), FormStateInterface&$form_state = NULL) {
28 28
     $element = [];
29 29
     foreach ($this->widget_ids as $id => $label) {
30
-      $name = 'tab_selector_' . $id;
30
+      $name = 'tab_selector_'.$id;
31 31
       $element[$name] = array(
32 32
         '#type' => 'button',
33 33
         '#attributes' => ['class' => ['tab']],
Please login to merge, or discard this patch.
src/Plugin/Field/FieldWidget/EntityReference.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
       $displays[$id] = $definition['label'];
129 129
     }
130 130
 
131
-    $id = Html::getUniqueId('field-' . $this->fieldDefinition->getName() . '-display-settings-wrapper');
131
+    $id = Html::getUniqueId('field-'.$this->fieldDefinition->getName().'-display-settings-wrapper');
132 132
     $element['field_widget_display'] = [
133 133
       '#title' => t('Entity display plugin'),
134 134
       '#type' => 'select',
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
       '#type' => 'fieldset',
145 145
       '#title' => t('Entity display plugin configuration'),
146 146
       '#tree' => TRUE,
147
-      '#prefix' => '<div id="' . $id . '">',
147
+      '#prefix' => '<div id="'.$id.'">',
148 148
       '#suffix' => '</div>',
149 149
     ];
150 150
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
       }
219 219
       // Submit was triggered by one of the "Remove" buttons. We need to walk
220 220
       // few levels up to read value of "target_id" element.
221
-      elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], $this->fieldDefinition->getName() . '_remove_') === 0) {
221
+      elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], $this->fieldDefinition->getName().'_remove_') === 0) {
222 222
         $parents = array_merge(array_slice($trigger['#parents'], 0, -4), ['target_id']);
223 223
       }
224 224
 
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
     }
242 242
     $ids = array_filter($ids);
243 243
 
244
-    $hidden_id = Html::getUniqueId('edit-' . $this->fieldDefinition->getName() . '-target-id');
245
-    $details_id = Html::getUniqueId('edit-' . $this->fieldDefinition->getName());
244
+    $hidden_id = Html::getUniqueId('edit-'.$this->fieldDefinition->getName().'-target-id');
245
+    $details_id = Html::getUniqueId('edit-'.$this->fieldDefinition->getName());
246 246
     /** @var \Drupal\entity_browser\EntityBrowserInterface $entity_browser */
247 247
     $entity_browser = $this->entityManager->getStorage('entity_browser')->load($this->getSetting('entity_browser'));
248 248
 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
                 'wrapper' => $details_id,
308 308
               ],
309 309
               '#submit' => [[get_class($this), 'removeItemSubmit']],
310
-              '#name' => $this->fieldDefinition->getName() . '_remove_' . $id,
310
+              '#name' => $this->fieldDefinition->getName().'_remove_'.$id,
311 311
               '#limit_validation_errors' => [array_merge($field_parents, [$this->fieldDefinition->getName()])],
312 312
               '#attributes' => ['data-entity-id' => $id],
313 313
             ]
Please login to merge, or discard this patch.