@@ -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') |
@@ -92,8 +92,7 @@ |
||
92 | 92 | $replacement_nodes = Html::load($content)->getElementsByTagName('body') |
93 | 93 | ->item(0) |
94 | 94 | ->childNodes; |
95 | - } |
|
96 | - else { |
|
95 | + } else { |
|
97 | 96 | $replacement_nodes = [$node->ownerDocument->createTextNode('')]; |
98 | 97 | } |
99 | 98 |
@@ -54,8 +54,7 @@ |
||
54 | 54 | $configuration = $this->getConfiguration(); |
55 | 55 | if (array_key_exists($name, $configuration)) { |
56 | 56 | return $configuration[$name]; |
57 | - } |
|
58 | - else { |
|
57 | + } else { |
|
59 | 58 | return $default; |
60 | 59 | } |
61 | 60 | } |
@@ -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 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $this->assertText($button_label, 'Test embed_button appears on the list page'); |
42 | 42 | |
43 | 43 | // Edit embed button. |
44 | - $this->drupalGet('admin/config/content/embed/button/manage/' . $button_id); |
|
44 | + $this->drupalGet('admin/config/content/embed/button/manage/'.$button_id); |
|
45 | 45 | $new_button_label = $this->randomMachineName(); |
46 | 46 | $edit = array( |
47 | 47 | 'label' => $new_button_label, |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | $this->assertNoText($button_label, 'Old label does not appears on the list page'); |
54 | 54 | |
55 | 55 | // Delete embed button. |
56 | - $this->drupalGet('admin/config/content/embed/button/manage/' . $button_id . '/delete'); |
|
56 | + $this->drupalGet('admin/config/content/embed/button/manage/'.$button_id.'/delete'); |
|
57 | 57 | $this->drupalPostForm(NULL, array(), 'Delete'); |
58 | 58 | // Ensure that the deleted embed button no longer exists. |
59 | - $this->drupalGet('admin/config/content/embed/button/manage/' . $button_id); |
|
59 | + $this->drupalGet('admin/config/content/embed/button/manage/'.$button_id); |
|
60 | 60 | $this->assertResponse(404, 'Deleted embed button no longer exists.'); |
61 | 61 | // Ensure that the deleted button is no longer listed. |
62 | 62 | $this->drupalGet('admin/config/content/embed'); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $this->drupalPostForm(NULL, $edit, 'Save'); |
83 | 83 | $this->assertText('Helicopters are just rotorcraft.'); |
84 | 84 | |
85 | - $this->drupalGet('admin/config/content/embed/button/manage/' . $button_id); |
|
85 | + $this->drupalGet('admin/config/content/embed/button/manage/'.$button_id); |
|
86 | 86 | $this->assertFieldByName('type_settings[aircraft_type]', 'rotorcraft'); |
87 | 87 | } |
88 | 88 |
@@ -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 | } |
@@ -102,8 +102,7 @@ discard block |
||
102 | 102 | public function getTypeLabel() { |
103 | 103 | if ($definition = $this->embedTypeManager()->getDefinition($this->getTypeId(), FALSE)) { |
104 | 104 | return $definition['label']; |
105 | - } |
|
106 | - else { |
|
105 | + } else { |
|
107 | 106 | return $this->t('Unknown'); |
108 | 107 | } |
109 | 108 | } |
@@ -132,8 +131,7 @@ discard block |
||
132 | 131 | public function getIconUrl() { |
133 | 132 | if ($image = $this->getIconFile()) { |
134 | 133 | return file_create_url($image->getFileUri()); |
135 | - } |
|
136 | - else { |
|
134 | + } else { |
|
137 | 135 | return $this->getTypePlugin()->getDefaultIconUrl(); |
138 | 136 | } |
139 | 137 | } |
@@ -217,8 +215,7 @@ discard block |
||
217 | 215 | public function getTypeSetting($key, $default = NULL) { |
218 | 216 | if (isset($this->type_settings[$key])) { |
219 | 217 | return $this->type_settings[$key]; |
220 | - } |
|
221 | - else { |
|
218 | + } else { |
|
222 | 219 | return $default; |
223 | 220 | } |
224 | 221 | } |
@@ -43,8 +43,7 @@ |
||
43 | 43 | '#uri' => $icon_url, |
44 | 44 | '#alt' => $this->t('Icon for the @label button.', ['@label' => $entity->label()]), |
45 | 45 | ]; |
46 | - } |
|
47 | - else { |
|
46 | + } else { |
|
48 | 47 | $row['icon'] = $this->t('None'); |
49 | 48 | } |
50 | 49 |