@@ -29,8 +29,7 @@ |
||
29 | 29 | // Copy and return the entity. |
30 | 30 | if ($copy = $this->replicator->replicateEntity($entity)) { |
31 | 31 | return $copy; |
32 | - } |
|
33 | - else { |
|
32 | + } else { |
|
34 | 33 | return false; |
35 | 34 | } |
36 | 35 | } |
@@ -25,8 +25,7 @@ |
||
25 | 25 | $data = file_get_contents($path); |
26 | 26 | $uri = file_build_uri($image); |
27 | 27 | $file = file_save_data($data, $uri); |
28 | - } |
|
29 | - else { |
|
28 | + } else { |
|
30 | 29 | $file = reset($files); |
31 | 30 | } |
32 | 31 |
@@ -40,14 +40,12 @@ discard block |
||
40 | 40 | if (is_array($value)) { |
41 | 41 | if ($this->isAssociative($value)) { |
42 | 42 | $output = array_merge($output, $this->doEncode($value, $keys)); |
43 | - } |
|
44 | - else { |
|
43 | + } else { |
|
45 | 44 | foreach ($value as $j) { |
46 | 45 | $output[] = $this->keysToString($keys) . '[] = ' . $j; |
47 | 46 | } |
48 | 47 | } |
49 | - } |
|
50 | - else { |
|
48 | + } else { |
|
51 | 49 | $output[] = $this->keysToString($keys) . ' = ' . $value; |
52 | 50 | } |
53 | 51 | |
@@ -70,8 +68,7 @@ discard block |
||
70 | 68 | $head = array_shift($keys); |
71 | 69 | if ($keys) { |
72 | 70 | return $head . '[' . implode('][', $keys) . ']'; |
73 | - } |
|
74 | - else { |
|
71 | + } else { |
|
75 | 72 | return $head; |
76 | 73 | } |
77 | 74 | } |
@@ -206,8 +206,7 @@ discard block |
||
206 | 206 | if ($media && $media->access('view')) { |
207 | 207 | if (isset(static::$recursiveRenderDepth[$mid])) { |
208 | 208 | static::$recursiveRenderDepth[$mid]++; |
209 | - } |
|
210 | - else { |
|
209 | + } else { |
|
211 | 210 | static::$recursiveRenderDepth[$mid] = 1; |
212 | 211 | } |
213 | 212 | |
@@ -236,8 +235,7 @@ discard block |
||
236 | 235 | $mids = \Drupal::entityQuery('media') |
237 | 236 | ->condition('uuid', $this->configuration['uuids'], 'IN') |
238 | 237 | ->execute(); |
239 | - } |
|
240 | - else { |
|
238 | + } else { |
|
241 | 239 | $mids = []; |
242 | 240 | } |
243 | 241 |
@@ -53,8 +53,7 @@ |
||
53 | 53 | foreach ($arguments as $argument) { |
54 | 54 | if ($argument{0} == '-') { |
55 | 55 | $task->rawArg($argument); |
56 | - } |
|
57 | - else { |
|
56 | + } else { |
|
58 | 57 | $feature = "tests/features/$argument"; |
59 | 58 | |
60 | 59 | if (file_exists("$feature.feature")) { |
@@ -126,8 +126,7 @@ |
||
126 | 126 | $coordinates = $this->getSetting('show_coordinates'); |
127 | 127 | if ($coordinates) { |
128 | 128 | $summary[] = $this->t('Coordinates are shown'); |
129 | - } |
|
130 | - else { |
|
129 | + } else { |
|
131 | 130 | $summary[] = $this->t('Coordinates are hidden'); |
132 | 131 | } |
133 | 132 |
@@ -29,8 +29,7 @@ |
||
29 | 29 | function df_tools_media_views_insert(ViewEntityInterface $view) { |
30 | 30 | if (\Drupal::isConfigSyncing()) { |
31 | 31 | return; |
32 | - } |
|
33 | - elseif (drupal_installation_attempted() && $view->id() == 'media') { |
|
32 | + } elseif (drupal_installation_attempted() && $view->id() == 'media') { |
|
34 | 33 | $display1 = &$view->getDisplay('entity_browser_1'); |
35 | 34 | $display2 = &$view->getDisplay('entity_browser_2'); |
36 | 35 | $display1['display_options']['filters']['field_tags_target_id'] = $display2['display_options']['filters']['field_tags_target_id'] = [ |
@@ -68,8 +68,7 @@ discard block |
||
68 | 68 | if (isset($options['langcode'])) { |
69 | 69 | $url_options['language'] = \Drupal::languageManager()->getLanguage($options['langcode']); |
70 | 70 | $langcode = $options['langcode']; |
71 | - } |
|
72 | - else { |
|
71 | + } else { |
|
73 | 72 | $langcode = NULL; |
74 | 73 | } |
75 | 74 | |
@@ -93,8 +92,7 @@ discard block |
||
93 | 92 | $replacements[$original] = Url::fromRoute('entity.node.latest_version', [ |
94 | 93 | 'node' => $node->id(), |
95 | 94 | ], $url_options)->toString(); |
96 | - } |
|
97 | - else { |
|
95 | + } else { |
|
98 | 96 | $replacements[$original] = $latest->toUrl('canonical', $url_options)->toString(); |
99 | 97 | } |
100 | 98 | break; |
@@ -78,8 +78,7 @@ discard block |
||
78 | 78 | ]; |
79 | 79 | } |
80 | 80 | unset($build[$field_name]); |
81 | - } |
|
82 | - elseif ($field_name !== 'field_hero_image') { |
|
81 | + } elseif ($field_name !== 'field_hero_image') { |
|
83 | 82 | $wrapper['#children'][$field_name] = $build[$field_name]; |
84 | 83 | unset($build[$field_name]); |
85 | 84 | } |
@@ -122,8 +121,7 @@ discard block |
||
122 | 121 | if ($r + $g + $b > 382) { |
123 | 122 | $wrapper['#children']['field_hero_link'][0]['#attributes']['class'][] = 'hero-link-light-bg'; |
124 | 123 | $style .= 'border-color:black;color:black;'; |
125 | - } |
|
126 | - else { |
|
124 | + } else { |
|
127 | 125 | $wrapper['#children']['field_hero_link'][0]['#attributes']['class'][] = 'hero-link-dark-bg'; |
128 | 126 | $style .= 'border-color:white;color:white;'; |
129 | 127 | } |
@@ -257,8 +255,7 @@ discard block |
||
257 | 255 | unset($form['flipper']['front']['settings']['view_mode']['#options'][$view_mode]); |
258 | 256 | } |
259 | 257 | } |
260 | - } |
|
261 | - elseif ($form['plugin_id']['#value'] === 'media_embed') { |
|
258 | + } elseif ($form['plugin_id']['#value'] === 'media_embed') { |
|
262 | 259 | if (empty(Element::getVisibleChildren($form['flipper']['front']['settings']['selection']['table'])) && !$form_state->isProcessingInput()) { |
263 | 260 | $form['#attached']['library'][] = 'df_tools_blocks/auto_open'; |
264 | 261 | $form['#attributes']['data-df-tools-blocks-auto-open'] = 'settings_selection_mids_entity_browser'; |
@@ -436,16 +433,14 @@ discard block |
||
436 | 433 | if (isset($category_map[$category])) { |
437 | 434 | // Already translated. |
438 | 435 | $block_info[$key]['category'] = $category_map[$category]; |
439 | - } |
|
440 | - elseif (is_string($block_info[$key]['category'])) { |
|
436 | + } elseif (is_string($block_info[$key]['category'])) { |
|
441 | 437 | // Already translated. |
442 | 438 | $block_info[$key]['category'] = $block_info[$key]['category']; |
443 | 439 | } |
444 | 440 | if (isset($label_map[$label])) { |
445 | 441 | // Already translated. |
446 | 442 | $block_info[$key]['label'] = $label_map[$label]; |
447 | - } |
|
448 | - elseif (is_string($block_info[$key]['label'])) { |
|
443 | + } elseif (is_string($block_info[$key]['label'])) { |
|
449 | 444 | // Already translated. |
450 | 445 | $block_info[$key]['label'] = $block_info[$key]['label']; |
451 | 446 | } |