Completed
Push — 8.x-1.x ( 7ded44...66b717 )
by Janez
02:10
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/Field/FieldFormatter/LinkEmbedFormatter.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@
 block discarded – undo
40 40
               '#template' => $info->getCode(),
41 41
             );
42 42
           }
43
-        }
44
-        catch (\Exception $exception) {
43
+        } catch (\Exception $exception) {
45 44
           watchdog_exception('url_embed', $exception);
46 45
         }
47 46
       }
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.
src/Plugin/Filter/UrlEmbedFilter.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,8 +76,7 @@  discard block
 block discarded – undo
76 76
           if ($info = $this->urlEmbed()->getEmbed($url)) {
77 77
             $url_output = $info->getCode();
78 78
           }
79
-        }
80
-        catch (\Exception $e) {
79
+        } catch (\Exception $e) {
81 80
           watchdog_exception('url_embed', $e);
82 81
         }
83 82
 
@@ -99,8 +98,7 @@  discard block
 block discarded – undo
99 98
         <ul>
100 99
           <li><code>&lt;drupal-url data-embed-url="https://www.youtube.com/watch?v=xxXXxxXxxxX" data-url-provider="YouTube" /&gt;</code></li>
101 100
         </ul>');
102
-    }
103
-    else {
101
+    } else {
104 102
       return $this->t('You can embed URLs.');
105 103
     }
106 104
   }
Please login to merge, or discard this patch.