Completed
Push — 8.x-1.x ( b30d75...4eb492 )
by Janez
02:40
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/Form/EntityBrowserForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
    * {@inheritdoc}
29 29
    */
30 30
   public function getFormId() {
31
-    return 'entity_browser_' . $this->entity->id() . '_form';
31
+    return 'entity_browser_'.$this->entity->id().'_form';
32 32
   }
33 33
 
34 34
   /**
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/Display/IFrame.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             'entity_browser' => [
153 153
               'iframe' => [
154 154
                 $uuid => [
155
-                  'src' => Url::fromRoute('entity_browser.' . $this->configuration['entity_browser_id'], [], [
155
+                  'src' => Url::fromRoute('entity_browser.'.$this->configuration['entity_browser_id'], [], [
156 156
                     'query' => [
157 157
                       'uuid' => $uuid,
158 158
                       'original_path' => $original_path,
@@ -190,13 +190,13 @@  discard block
 block discarded – undo
190 190
   public function propagateSelection(FilterResponseEvent $event) {
191 191
     $render = [
192 192
       'labels' => [
193
-        '#markup' => 'Labels: ' . implode(', ', array_map(function (EntityInterface $item) {return $item->label();}, $this->entities)),
193
+        '#markup' => 'Labels: '.implode(', ', array_map(function(EntityInterface $item) {return $item->label(); }, $this->entities)),
194 194
         '#attached' => [
195 195
           'library' => ['entity_browser/iframe_selection'],
196 196
           'drupalSettings' => [
197 197
             'entity_browser' => [
198 198
               'iframe' => [
199
-                'entities' => array_map(function (EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()];}, $this->entities),
199
+                'entities' => array_map(function(EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()]; }, $this->entities),
200 200
                 'uuid' => $this->request->query->get('uuid'),
201 201
               ],
202 202
             ],
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
    * {@inheritdoc}
223 223
    */
224 224
   public function path() {
225
-    return '/entity-browser/iframe/' . $this->configuration['entity_browser_id'];
225
+    return '/entity-browser/iframe/'.$this->configuration['entity_browser_id'];
226 226
   }
227 227
 
228 228
 }
Please login to merge, or discard this patch.
src/Plugin/EntityBrowser/Display/Modal.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
       '#theme_wrappers' => ['container'],
143 143
       'path' => [
144 144
         '#type' => 'hidden',
145
-        '#value' => Url::fromRoute('entity_browser.' . $this->configuration['entity_browser_id'], [], [
145
+        '#value' => Url::fromRoute('entity_browser.'.$this->configuration['entity_browser_id'], [], [
146 146
           'query' => [
147 147
             'uuid' => $uuid,
148 148
             'original_path' => $original_path,
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         '#value' => $this->configuration['link_text'],
155 155
         '#limit_validation_errors' => [],
156 156
         '#submit' => [],
157
-        '#name' => 'op_' . $this->configuration['entity_browser_id'],
157
+        '#name' => 'op_'.$this->configuration['entity_browser_id'],
158 158
         '#ajax' => [
159 159
           'callback' => [$this, 'openModal'],
160 160
           'event' => 'click',
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
           'data-uuid' => $uuid,
164 164
         ],
165 165
         '#attached' => [
166
-          'library' => ['core/drupal.dialog.ajax',  'entity_browser/modal'],
166
+          'library' => ['core/drupal.dialog.ajax', 'entity_browser/modal'],
167 167
           'drupalSettings' => [
168 168
             'entity_browser' => [
169 169
               'modal' => [
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
    *   An array of ajax commands.
284 284
    */
285 285
   public function getAjaxCommands(FormStateInterface $form_state) {
286
-    $entities = array_map(function(EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()];}, $form_state->get(['entity_browser', 'selected_entities']));
286
+    $entities = array_map(function(EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()]; }, $form_state->get(['entity_browser', 'selected_entities']));
287 287
 
288 288
     $commands = array();
289 289
     $commands[] = new SelectEntitiesCommand($this->uuid, $entities);
@@ -303,13 +303,13 @@  discard block
 block discarded – undo
303 303
   public function propagateSelection(FilterResponseEvent $event) {
304 304
     $render = [
305 305
       'labels' => [
306
-        '#markup' => 'Labels: ' . implode(', ', array_map(function (EntityInterface $item) {return $item->label();}, $this->entities)),
306
+        '#markup' => 'Labels: '.implode(', ', array_map(function(EntityInterface $item) {return $item->label(); }, $this->entities)),
307 307
         '#attached' => [
308 308
           'library' => ['entity_browser/modal_selection'],
309 309
           'drupalSettings' => [
310 310
             'entity_browser' => [
311 311
               'modal' => [
312
-                'entities' => array_map(function (EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()];}, $this->entities),
312
+                'entities' => array_map(function(EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()]; }, $this->entities),
313 313
                 'uuid' => $this->request->query->get('uuid'),
314 314
               ],
315 315
             ],
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
    * {@inheritdoc}
326 326
    */
327 327
   public function path() {
328
-    return '/entity-browser/modal/' . $this->configuration['entity_browser_id'];
328
+    return '/entity-browser/modal/'.$this->configuration['entity_browser_id'];
329 329
   }
330 330
 
331 331
   /**
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.