Completed
Pull Request — 8.x-1.x (#32)
by Janez
04:18
created
src/Form/UrlEmbedDialog.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -109,8 +109,7 @@  discard block
 block discarded – undo
109 109
       if (!empty($url_element['data-embed-url']) && $info = $this->urlEmbed()->getEmbed($url_element['data-embed-url'])) {
110 110
         $url_element['data-url-provider'] = $info->getProviderName();
111 111
       }
112
-    }
113
-    catch (\Exception $e) {
112
+    } catch (\Exception $e) {
114 113
       watchdog_exception('url_embed', $e);
115 114
     }
116 115
 
@@ -160,8 +159,7 @@  discard block
 block discarded – undo
160 159
         '#weight' => -10,
161 160
       );
162 161
       $response->addCommand(new HtmlCommand('#url-embed-dialog-form', $form));
163
-    }
164
-    else {
162
+    } else {
165 163
       $response->addCommand(new EditorDialogSave($values));
166 164
       $response->addCommand(new CloseModalDialogCommand());
167 165
     }
Please login to merge, or discard this patch.
src/Plugin/Filter/UrlEmbedFilter.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -77,8 +77,7 @@  discard block
 block discarded – undo
77 77
             $url_output = $info->getCode();
78 78
             $node->setAttribute('data-url-provider', $info->getProviderName());
79 79
           }
80
-        }
81
-        catch (\Exception $e) {
80
+        } catch (\Exception $e) {
82 81
           watchdog_exception('url_embed', $e);
83 82
         }
84 83
 
@@ -100,8 +99,7 @@  discard block
 block discarded – undo
100 99
         <ul>
101 100
           <li><code>&lt;drupal-url data-embed-url="https://www.youtube.com/watch?v=xxXXxxXxxxX" data-url-provider="YouTube" /&gt;</code></li>
102 101
         </ul>');
103
-    }
104
-    else {
102
+    } else {
105 103
       return $this->t('You can embed URLs.');
106 104
     }
107 105
   }
Please login to merge, or discard this patch.
src/Plugin/Filter/ConvertUrlToEmbedFilter.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -140,8 +140,7 @@  discard block
 block discarded – undo
140 140
             function ($match) {
141 141
               if (\Drupal::service('url_embed')->getEmbed(Html::decodeEntities($match[1]))) {
142 142
                 return '<drupal-url data-embed-url="' . $match[1] . '"></drupal-url>';
143
-              }
144
-              else {
143
+              } else {
145 144
                 return $match[1];
146 145
               }
147 146
             },
@@ -150,8 +149,7 @@  discard block
 block discarded – undo
150 149
         }
151 150
         // Text chunk is done, so next chunk must be a tag.
152 151
         $chunk_type = 'tag';
153
-      }
154
-      else {
152
+      } else {
155 153
         // Only process this tag if there are no unclosed $ignore_tags.
156 154
         if ($open_tag == '') {
157 155
           // Check whether this tag is contained in $ignore_tags.
@@ -182,8 +180,7 @@  discard block
 block discarded – undo
182 180
   public function tips($long = FALSE) {
183 181
     if ($long) {
184 182
       return $this->t('<p>You can convert plain URLs to &lt;drupal-url&gt; HTML elements. Those elements are later converted to embeds using "Display embedded URLs" text filter.</p>');
185
-    }
186
-    else {
183
+    } else {
187 184
       return $this->t('You can convert plain URLs to embed elements.');
188 185
     }
189 186
   }
Please login to merge, or discard this patch.