Completed
Pull Request — 8.x-1.x (#28)
by Devin
02:51
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/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/CKEditorPlugin/DrupalUrl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
    * {@inheritdoc}
26 26
    */
27 27
   public function getFile() {
28
-    return drupal_get_path('module', 'url_embed') . '/js/plugins/drupalurl/plugin.js';
28
+    return drupal_get_path('module', 'url_embed').'/js/plugins/drupalurl/plugin.js';
29 29
   }
30 30
 
31 31
   /**
Please login to merge, or discard this patch.
src/Plugin/EmbedType/Url.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,6 +23,6 @@
 block discarded – undo
23 23
    * {@inheritdoc}
24 24
    */
25 25
   public function getDefaultIconUrl() {
26
-    return file_create_url(drupal_get_path('module', 'url_embed') . '/js/plugins/drupalurl/urlembed.png');
26
+    return file_create_url(drupal_get_path('module', 'url_embed').'/js/plugins/drupalurl/urlembed.png');
27 27
   }
28 28
 }
Please login to merge, or discard this patch.
src/Tests/LinkEmbedFormatterTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
  *
19 19
  * @group url_embed
20 20
  */
21
-class LinkEmbedFormatterTest extends LinkFieldTest{
21
+class LinkEmbedFormatterTest extends LinkFieldTest {
22 22
 
23 23
   /**
24 24
    * Modules to enable.
Please login to merge, or discard this patch.
src/Tests/UrlEmbedDialogTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,9 +66,9 @@
 block discarded – undo
66 66
   public function getEmbedDialog($filter_format_id = NULL, $embed_button_id = NULL) {
67 67
     $url = 'url-embed/dialog';
68 68
     if (!empty($filter_format_id)) {
69
-      $url .= '/' . $filter_format_id;
69
+      $url .= '/'.$filter_format_id;
70 70
       if (!empty($embed_button_id)) {
71
-        $url .= '/' . $embed_button_id;
71
+        $url .= '/'.$embed_button_id;
72 72
       }
73 73
     }
74 74
     return $this->drupalGet($url);
Please login to merge, or discard this patch.
src/Tests/UrlEmbedFilterTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
    */
23 23
   public function testFilter() {
24 24
     // Tests url embed using sample flickr url.
25
-    $content = '<drupal-url data-embed-url="' . static::FLICKR_URL . '">This placeholder should not be rendered.</drupal-url>';
25
+    $content = '<drupal-url data-embed-url="'.static::FLICKR_URL.'">This placeholder should not be rendered.</drupal-url>';
26 26
     $settings = array();
27 27
     $settings['type'] = 'page';
28 28
     $settings['title'] = 'Test url embed with sample flickr url';
29 29
     $settings['body'] = array(array('value' => $content, 'format' => 'custom_format'));
30 30
     $node = $this->drupalCreateNode($settings);
31
-    $this->drupalGet('node/' . $node->id());
31
+    $this->drupalGet('node/'.$node->id());
32 32
     $this->assertRaw(static::FLICKR_OUTPUT_WYSIWYG);
33 33
     $this->assertNoText(strip_tags($content), 'Placeholder does not appear in the output when embed is successful.');
34 34
 
@@ -39,27 +39,27 @@  discard block
 block discarded – undo
39 39
     $settings['title'] = 'Test that placeholder is retained when specified URL does not exists';
40 40
     $settings['body'] = array(array('value' => $content, 'format' => 'custom_format'));
41 41
     $node = $this->drupalCreateNode($settings);
42
-    $this->drupalGet('node/' . $node->id());
42
+    $this->drupalGet('node/'.$node->id());
43 43
     $this->assertNoText(strip_tags($content), 'Placeholder does not appear in the output when embed is unsuccessful.');
44 44
 
45 45
     // Test that tag of container element is not replaced when it's not
46 46
     // <drupal-url>.
47
-    $content = '<not-drupal-url data-embed-url="' . static::FLICKR_URL . '" data-url-provider="Flickr">this placeholder should not be rendered.</not-drupal-url>';
47
+    $content = '<not-drupal-url data-embed-url="'.static::FLICKR_URL.'" data-url-provider="Flickr">this placeholder should not be rendered.</not-drupal-url>';
48 48
     $settings = array();
49 49
     $settings['type'] = 'page';
50 50
     $settings['title'] = 'test url embed with embed-url';
51 51
     $settings['body'] = array(array('value' => $content, 'format' => 'custom_format'));
52 52
     $node = $this->drupalCreateNode($settings);
53
-    $this->drupalget('node/' . $node->id());
53
+    $this->drupalget('node/'.$node->id());
54 54
     $this->assertRaw('</not-drupal-url>');
55
-    $content = '<div data-embed-url="' . static::FLICKR_URL . '">this placeholder should not be rendered.</div>';
55
+    $content = '<div data-embed-url="'.static::FLICKR_URL.'">this placeholder should not be rendered.</div>';
56 56
     $settings = array();
57 57
     $settings['type'] = 'page';
58 58
     $settings['title'] = 'test url embed with embed-url';
59 59
     $settings['body'] = array(array('value' => $content, 'format' => 'custom_format'));
60 60
     $node = $this->drupalCreateNode($settings);
61
-    $this->drupalget('node/' . $node->id());
62
-    $this->assertRaw('<div data-embed-url="' . static::FLICKR_URL . '"');
61
+    $this->drupalget('node/'.$node->id());
62
+    $this->assertRaw('<div data-embed-url="'.static::FLICKR_URL.'"');
63 63
   }
64 64
 
65 65
 }
Please login to merge, or discard this patch.