@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @param string $name |
28 | 28 | * The new tag name. |
29 | 29 | */ |
30 | - protected function changeNodeName(\DOMNode &$node, $name = 'div') { |
|
30 | + protected function changeNodeName(\DOMNode&$node, $name = 'div') { |
|
31 | 31 | if ($node->nodeName != $name) { |
32 | 32 | /** @var \DOMElement $replacement_node */ |
33 | 33 | $replacement_node = $node->ownerDocument->createElement($name); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param string $content |
87 | 87 | * The text or HTML that will replace the contents of $node. |
88 | 88 | */ |
89 | - protected function replaceNodeContent(\DOMNode &$node, $content) { |
|
89 | + protected function replaceNodeContent(\DOMNode&$node, $content) { |
|
90 | 90 | if (strlen($content)) { |
91 | 91 | // Load the content into a new DOMDocument and retrieve the DOM nodes. |
92 | 92 | $replacement_nodes = Html::load($content)->getElementsByTagName('body') |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * An array of valid plugin labels, keyed by plugin ID. |
44 | 44 | */ |
45 | 45 | public function getDefinitionOptions() { |
46 | - $options = array_map(function ($definition) { |
|
46 | + $options = array_map(function($definition) { |
|
47 | 47 | return (string) $definition['label']; |
48 | 48 | }, $this->getDefinitions()); |
49 | 49 | natsort($options); |
@@ -61,7 +61,7 @@ |
||
61 | 61 | * The retrieved HTML string. |
62 | 62 | */ |
63 | 63 | public function getRoute($filter_format_id, $value = NULL) { |
64 | - $url = 'embed/preview/' . $filter_format_id; |
|
64 | + $url = 'embed/preview/'.$filter_format_id; |
|
65 | 65 | if (!isset($value)) { |
66 | 66 | $value = static::SUCCESS; |
67 | 67 | } |
@@ -77,7 +77,7 @@ |
||
77 | 77 | * The retrieved HTML string. |
78 | 78 | */ |
79 | 79 | public function getRoute($editor_id, $embed_button_id, $value = NULL) { |
80 | - $url = 'embed-test/access/' . $editor_id . '/' . $embed_button_id; |
|
80 | + $url = 'embed-test/access/'.$editor_id.'/'.$embed_button_id; |
|
81 | 81 | if (!isset($value)) { |
82 | 82 | $value = static::SUCCESS; |
83 | 83 | } |
@@ -138,26 +138,26 @@ discard block |
||
138 | 138 | $wrapperNode = NULL; |
139 | 139 | // When a command specifies a specific selector, use it. |
140 | 140 | if (!empty($command['selector']) && strpos($command['selector'], '#') === 0) { |
141 | - $wrapperNode = $xpath->query('//*[@id="' . substr($command['selector'], 1) . '"]')->item(0); |
|
141 | + $wrapperNode = $xpath->query('//*[@id="'.substr($command['selector'], 1).'"]')->item(0); |
|
142 | 142 | } |
143 | 143 | // When a command doesn't specify a selector, use the |
144 | 144 | // #ajax['wrapper'] which is always an HTML ID. |
145 | 145 | elseif (!empty($ajax_settings['wrapper'])) { |
146 | - $wrapperNode = $xpath->query('//*[@id="' . $ajax_settings['wrapper'] . '"]')->item(0); |
|
146 | + $wrapperNode = $xpath->query('//*[@id="'.$ajax_settings['wrapper'].'"]')->item(0); |
|
147 | 147 | } |
148 | 148 | // @todo Ajax commands can target any jQuery selector, but these are |
149 | 149 | // hard to fully emulate with XPath. For now, just handle 'head' |
150 | 150 | // and 'body', since these are used by |
151 | 151 | // \Drupal\Core\Ajax\AjaxResponse::ajaxRender(). |
152 | 152 | elseif (in_array($command['selector'], array('head', 'body'))) { |
153 | - $wrapperNode = $xpath->query('//' . $command['selector'])->item(0); |
|
153 | + $wrapperNode = $xpath->query('//'.$command['selector'])->item(0); |
|
154 | 154 | } |
155 | 155 | if ($wrapperNode) { |
156 | 156 | // ajax.js adds an enclosing DIV to work around a Safari bug. |
157 | 157 | $newDom = new \DOMDocument(); |
158 | 158 | // DOM can load HTML soup. But, HTML soup can throw warnings, |
159 | 159 | // suppress them. |
160 | - @$newDom->loadHTML('<div>' . $command['data'] . '</div>'); |
|
160 | + @$newDom->loadHTML('<div>'.$command['data'].'</div>'); |
|
161 | 161 | // Suppress warnings thrown when duplicate HTML IDs are encountered. |
162 | 162 | // This probably means we are replacing an element with the same ID. |
163 | 163 | $newNode = @$dom->importNode($newDom->documentElement->firstChild->firstChild, TRUE); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | case 'add_css': |
210 | 210 | break; |
211 | 211 | case 'update_build_id': |
212 | - $buildId = $xpath->query('//input[@name="form_build_id" and @value="' . $command['old'] . '"]')->item(0); |
|
212 | + $buildId = $xpath->query('//input[@name="form_build_id" and @value="'.$command['old'].'"]')->item(0); |
|
213 | 213 | if ($buildId) { |
214 | 214 | $buildId->setAttribute('value', $command['new']); |
215 | 215 | } |
@@ -130,7 +130,7 @@ |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | $config = $this->config('embed.settings'); |
133 | - $upload_location = $config->get('file_scheme') . '://' . $config->get('upload_directory') . '/'; |
|
133 | + $upload_location = $config->get('file_scheme').'://'.$config->get('upload_directory').'/'; |
|
134 | 134 | $form['icon_file'] = [ |
135 | 135 | '#title' => $this->t('Button icon'), |
136 | 136 | '#type' => 'managed_file', |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $this->assertText($button_label, 'Test embed_button appears on the list page'); |
37 | 37 | |
38 | 38 | // Edit embed button. |
39 | - $this->drupalGet('admin/config/content/embed/button/manage/' . $button_id); |
|
39 | + $this->drupalGet('admin/config/content/embed/button/manage/'.$button_id); |
|
40 | 40 | $new_button_label = $this->randomMachineName(); |
41 | 41 | $edit = [ |
42 | 42 | 'label' => $new_button_label, |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | $this->assertNoText($button_label, 'Old label does not appears on the list page'); |
49 | 49 | |
50 | 50 | // Delete embed button. |
51 | - $this->drupalGet('admin/config/content/embed/button/manage/' . $button_id . '/delete'); |
|
51 | + $this->drupalGet('admin/config/content/embed/button/manage/'.$button_id.'/delete'); |
|
52 | 52 | $this->drupalPostForm(NULL, [], 'Delete'); |
53 | 53 | // Ensure that the deleted embed button no longer exists. |
54 | - $this->drupalGet('admin/config/content/embed/button/manage/' . $button_id); |
|
54 | + $this->drupalGet('admin/config/content/embed/button/manage/'.$button_id); |
|
55 | 55 | $this->assertResponse(404, 'Deleted embed button no longer exists.'); |
56 | 56 | // Ensure that the deleted button is no longer listed. |
57 | 57 | $this->drupalGet('admin/config/content/embed'); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $this->drupalPostForm(NULL, $edit, 'Save'); |
78 | 78 | $this->assertText('Helicopters are just rotorcraft.'); |
79 | 79 | |
80 | - $this->drupalGet('admin/config/content/embed/button/manage/' . $button_id); |
|
80 | + $this->drupalGet('admin/config/content/embed/button/manage/'.$button_id); |
|
81 | 81 | $this->assertFieldByName('type_settings[aircraft_type]', 'rotorcraft'); |
82 | 82 | } |
83 | 83 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $ckeditor_plugin_manager = \Drupal::service('plugin.manager.ckeditor.plugin'); |
21 | 21 | |
22 | 22 | // Get a list of all buttons that are provided by all plugins. |
23 | - $button_ids = array_reduce($ckeditor_plugin_manager->getButtons(), function ($result, $item) { |
|
23 | + $button_ids = array_reduce($ckeditor_plugin_manager->getButtons(), function($result, $item) { |
|
24 | 24 | return array_merge($result, array_keys($item)); |
25 | 25 | }, []); |
26 | 26 |