@@ -60,7 +60,7 @@ |
||
60 | 60 | if ($node = $event->getRequest()->get('node')) { |
61 | 61 | if (\Drupal::currentUser()->hasPermission('view latest version')) { |
62 | 62 | $theme = $this->themeManager->getActiveTheme()->getName(); |
63 | - $tag = 'config:block.block.' . $theme . '_local_actions'; |
|
63 | + $tag = 'config:block.block.'.$theme.'_local_actions'; |
|
64 | 64 | $this->cacheTagsInvalidator->invalidateTags([$tag]); |
65 | 65 | } |
66 | 66 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * {@inheritdoc} |
19 | 19 | */ |
20 | 20 | public static function getSubscribedEvents() { |
21 | - $events[RoutingEvents::ALTER] = ['onAlterRoutes',-9999]; // negative Values means "late" |
|
21 | + $events[RoutingEvents::ALTER] = ['onAlterRoutes', -9999]; // negative Values means "late" |
|
22 | 22 | return $events; |
23 | 23 | } |
24 | 24 |
@@ -22,12 +22,12 @@ |
||
22 | 22 | public function build() { |
23 | 23 | $build = [ |
24 | 24 | '#markup' => |
25 | - '<div class="df-tools-magellan-block hide-for-small-only full-width-row sticky-container">' . |
|
26 | - ' <div data-sticky-light>' . |
|
27 | - ' <nav data-magellan-light>' . |
|
28 | - ' <ul class="horizontal menu nav expanded"></ul>' . |
|
29 | - ' </nav>' . |
|
30 | - ' </div>' . |
|
25 | + '<div class="df-tools-magellan-block hide-for-small-only full-width-row sticky-container">'. |
|
26 | + ' <div data-sticky-light>'. |
|
27 | + ' <nav data-magellan-light>'. |
|
28 | + ' <ul class="horizontal menu nav expanded"></ul>'. |
|
29 | + ' </nav>'. |
|
30 | + ' </div>'. |
|
31 | 31 | '</div>', |
32 | 32 | ]; |
33 | 33 |
@@ -112,8 +112,7 @@ discard block |
||
112 | 112 | $name = 'drupal'; |
113 | 113 | } |
114 | 114 | $info['projects'][$name] = $this->buildProject($package); |
115 | - } |
|
116 | - elseif ($this->isLightning($package)) { |
|
115 | + } elseif ($this->isLightning($package)) { |
|
117 | 116 | $info['projects'][$name] = $this->buildProject($package); |
118 | 117 | |
119 | 118 | // The Lightning project uses semantic versioning. |
@@ -283,8 +282,7 @@ discard block |
||
283 | 282 | 'type' => 'get', |
284 | 283 | 'url' => $package['dist']['url'], |
285 | 284 | ]; |
286 | - } |
|
287 | - else { |
|
285 | + } else { |
|
288 | 286 | $download = [ |
289 | 287 | 'type' => 'git', |
290 | 288 | 'url' => str_replace('[email protected]:', 'https://github.com/', $package['source']['url']), |
@@ -9,8 +9,7 @@ |
||
9 | 9 | // Set container for Navbar |
10 | 10 | if (theme_get_setting('navbar_full_width')) { |
11 | 11 | $variables['navbar_width'] = 'container-fluid'; |
12 | - } |
|
13 | - else { |
|
12 | + } else { |
|
14 | 13 | $variables['navbar_width'] = 'container'; |
15 | 14 | } |
16 | 15 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | function one_theme_suggestions_menu_alter(&$suggestions, array $variables) { |
25 | 25 | if (isset($variables['attributes']['region'])) { |
26 | - $suggestions[] = 'menu__' . $variables['attributes']['region']; |
|
27 | - $suggestions[] = 'menu__' . $variables['menu_name'] . '__' . $variables['attributes']['region']; |
|
26 | + $suggestions[] = 'menu__'.$variables['attributes']['region']; |
|
27 | + $suggestions[] = 'menu__'.$variables['menu_name'].'__'.$variables['attributes']['region']; |
|
28 | 28 | } |
29 | 29 | } |
@@ -13,6 +13,6 @@ |
||
13 | 13 | $view_mode = $element['#view_mode']; |
14 | 14 | |
15 | 15 | foreach ($original_suggestions as $suggestion) { |
16 | - $suggestions[] = $suggestion . '__' . $view_mode; |
|
16 | + $suggestions[] = $suggestion.'__'.$view_mode; |
|
17 | 17 | } |
18 | 18 | } |
@@ -95,8 +95,7 @@ discard block |
||
95 | 95 | ]; |
96 | 96 | } |
97 | 97 | unset($build[$field_name]); |
98 | - } |
|
99 | - elseif ($field_name !== 'field_hero_background') { |
|
98 | + } elseif ($field_name !== 'field_hero_background') { |
|
100 | 99 | $wrapper['#children'][$field_name] = $build[$field_name]; |
101 | 100 | unset($build[$field_name]); |
102 | 101 | } |
@@ -139,8 +138,7 @@ discard block |
||
139 | 138 | if ($r + $g + $b > 382) { |
140 | 139 | $wrapper['#children']['field_hero_link'][0]['#attributes']['class'][] = 'hero-link-light-bg'; |
141 | 140 | $style .= 'border-color:black;color:black;'; |
142 | - } |
|
143 | - else { |
|
141 | + } else { |
|
144 | 142 | $wrapper['#children']['field_hero_link'][0]['#attributes']['class'][] = 'hero-link-dark-bg'; |
145 | 143 | $style .= 'border-color:white;color:white;'; |
146 | 144 | } |
@@ -274,8 +272,7 @@ discard block |
||
274 | 272 | unset($form['flipper']['front']['settings']['view_mode']['#options'][$view_mode]); |
275 | 273 | } |
276 | 274 | } |
277 | - } |
|
278 | - elseif ($form['plugin_id']['#value'] === 'media_embed') { |
|
275 | + } elseif ($form['plugin_id']['#value'] === 'media_embed') { |
|
279 | 276 | if (empty(Element::getVisibleChildren($form['flipper']['front']['settings']['selection']['table'])) && !$form_state->isProcessingInput()) { |
280 | 277 | $form['#attached']['library'][] = 'df_tools_blocks/auto_open'; |
281 | 278 | $form['#attributes']['data-df-tools-blocks-auto-open'] = 'settings_selection_mids_entity_browser'; |
@@ -453,16 +450,14 @@ discard block |
||
453 | 450 | if (isset($category_map[$category])) { |
454 | 451 | // Already translated. |
455 | 452 | $block_info[$key]['category'] = $category_map[$category]; |
456 | - } |
|
457 | - elseif (is_string($block_info[$key]['category'])) { |
|
453 | + } elseif (is_string($block_info[$key]['category'])) { |
|
458 | 454 | // Already translated. |
459 | 455 | $block_info[$key]['category'] = $block_info[$key]['category']; |
460 | 456 | } |
461 | 457 | if (isset($label_map[$label])) { |
462 | 458 | // Already translated. |
463 | 459 | $block_info[$key]['label'] = $label_map[$label]; |
464 | - } |
|
465 | - elseif (is_string($block_info[$key]['label'])) { |
|
460 | + } elseif (is_string($block_info[$key]['label'])) { |
|
466 | 461 | // Already translated. |
467 | 462 | $block_info[$key]['label'] = $block_info[$key]['label']; |
468 | 463 | } |
@@ -287,7 +287,7 @@ |
||
287 | 287 | // Move the hero image out of the details element and set a better label. |
288 | 288 | $element['field_hero_background']['widget']['#type'] = 'container'; |
289 | 289 | $element['field_hero_background']['widget']['entity_browser']['#process'][] = '_df_tools_blocks_hero_browser_button'; |
290 | - // Remove the link fieldset and put the URI and title side-by-side. |
|
290 | + // Remove the link fieldset and put the URI and title side-by-side. |
|
291 | 291 | $element['field_hero_link']['widget'][0]['#type'] = 'container'; |
292 | 292 | $element['field_hero_link']['widget'][0]['#attributes']['class'][] = 'row'; |
293 | 293 | unset($element['field_hero_link']['widget'][0]['uri']['#description']); |
@@ -53,12 +53,12 @@ discard block |
||
53 | 53 | $hero_callout_width = $entity->get('field_callout_width')->getString(); |
54 | 54 | |
55 | 55 | $wrapper = [ |
56 | - '#prefix' => '<div class="content"><div class="fields-container ' . $hero_alignment . '">', |
|
56 | + '#prefix' => '<div class="content"><div class="fields-container '.$hero_alignment.'">', |
|
57 | 57 | '#suffix' => '</div></div>', |
58 | 58 | '#type' => 'container', |
59 | 59 | '#weight' => -1, |
60 | 60 | '#attributes' => [ |
61 | - 'class' => ['fields', 'col-' . $hero_callout_width, $text_alignment ], |
|
61 | + 'class' => ['fields', 'col-'.$hero_callout_width, $text_alignment], |
|
62 | 62 | ], |
63 | 63 | '#children' => [], |
64 | 64 | ]; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $icon = $build[$field_name]['#object']->field_icon->getString(); |
68 | 68 | if (!empty($icon)) { |
69 | 69 | $wrapper['#children'][$field_name] = [ |
70 | - '#markup' => '<i class="fa ' . $icon . ' hero-icon"></i>', |
|
70 | + '#markup' => '<i class="fa '.$icon.' hero-icon"></i>', |
|
71 | 71 | '#allowed_tags' => ['i'], |
72 | 72 | ]; |
73 | 73 | } |
@@ -80,15 +80,15 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | $hero_first_line_size = $entity->get('field_first_line_size')->getString(); |
83 | - $wrapper['#children']['field_first_line']['#attributes']['class'][] = 'size-' . $hero_first_line_size; |
|
83 | + $wrapper['#children']['field_first_line']['#attributes']['class'][] = 'size-'.$hero_first_line_size; |
|
84 | 84 | |
85 | 85 | $hero_second_line_size = $entity->get('field_second_line_size')->getString(); |
86 | - $wrapper['#children']['field_second_line']['#attributes']['class'][] = 'size-' . $hero_second_line_size; |
|
86 | + $wrapper['#children']['field_second_line']['#attributes']['class'][] = 'size-'.$hero_second_line_size; |
|
87 | 87 | |
88 | 88 | // Attach styles. |
89 | 89 | $alignment = $entity->get('field_hero_alignment')->getString(); |
90 | 90 | if (preg_match('/^[a-z_]+$/i', $alignment)) { |
91 | - $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('text-align-' . $text_alignment); |
|
91 | + $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('text-align-'.$text_alignment); |
|
92 | 92 | } |
93 | 93 | $color_regex = '/^#[0-9a-f]{6}$/i'; |
94 | 94 | $callout_background_color = $entity->get('field_callout_background_color')->getString(); |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | $wrapper['#attributes']['style'] = $callout_background_color; |
102 | 102 | $text_color = $entity->get('field_text_color')->getString(); |
103 | 103 | if (preg_match($color_regex, $text_color)) { |
104 | - $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
105 | - $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
104 | + $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: '.$text_color; |
|
105 | + $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: '.$text_color; |
|
106 | 106 | } |
107 | 107 | if ($entity->get('field_gradient')->getString()) { |
108 | 108 | $gradient_color = $entity->get('field_gradient_color')->getString(); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } |
126 | 126 | $callout_color = $entity->get('field_callout_color')->getString(); |
127 | 127 | if (preg_match($color_regex, $callout_color)) { |
128 | - $style = 'background-color: ' . $callout_color . ';'; |
|
128 | + $style = 'background-color: '.$callout_color.';'; |
|
129 | 129 | $hex = trim($callout_color, '#'); |
130 | 130 | $r = hexdec(substr($hex, 0, 2)); |
131 | 131 | $g = hexdec(substr($hex, 2, 2)); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | if (isset($variables['elements']['content']) && isset($variables['elements']['content']['#block_content'])) { |
179 | 179 | /** @var \Drupal\block_content\Entity\BlockContent $entity */ |
180 | 180 | $entity = $variables['elements']['content']['#block_content']; |
181 | - $suggestions[] = 'block__block_content__' . $entity->bundle(); |
|
181 | + $suggestions[] = 'block__block_content__'.$entity->bundle(); |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | // 'Current @Entity_Type' category. If the block is not a field on the |
466 | 466 | // current entity, allow its category to be remapped. |
467 | 467 | if ($category === '@entity') { |
468 | - $block_info[$key]['category'] = $info['category']->render() . ' Fields'; |
|
468 | + $block_info[$key]['category'] = $info['category']->render().' Fields'; |
|
469 | 469 | } |
470 | 470 | // Place Block Content entities into categories based on their type. |
471 | 471 | elseif ($category === 'Custom') { |
@@ -28,8 +28,7 @@ discard block |
||
28 | 28 | if ($arg[0] == 'node' && isset($arg[1])) { |
29 | 29 | if ($arg[1] == 'add') { |
30 | 30 | $section = 'node-add'; |
31 | - } |
|
32 | - elseif (isset($arg[2]) && is_numeric($arg[1]) && ($arg[2] == 'edit' || $arg[2] == 'delete')) { |
|
31 | + } elseif (isset($arg[2]) && is_numeric($arg[1]) && ($arg[2] == 'edit' || $arg[2] == 'delete')) { |
|
33 | 32 | $section = 'node-' . $arg[2]; |
34 | 33 | } |
35 | 34 | } |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | // Store the menu item since it has some useful information. |
40 | 39 | if ($request->attributes->get('view_id')) { |
41 | 40 | $variables['attributes']['class'][] = 'views-page'; |
42 | - } |
|
43 | - elseif ($request->attributes->get('panel')) { |
|
41 | + } elseif ($request->attributes->get('panel')) { |
|
44 | 42 | $variables['attributes']['class'][] = 'panels-page'; |
45 | 43 | } |
46 | 44 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $request = \Drupal::request(); |
19 | 19 | |
20 | 20 | // Add language body class. |
21 | - $variables['attributes']['class'][] = 'lang-' . $site_language; |
|
21 | + $variables['attributes']['class'][] = 'lang-'.$site_language; |
|
22 | 22 | |
23 | 23 | // Classes for body element. Allows advanced theming based on context |
24 | 24 | $is_front_page = \Drupal::service('path.matcher')->isFrontPage(); |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $section = 'node-add'; |
33 | 33 | } |
34 | 34 | elseif (isset($arg[2]) && is_numeric($arg[1]) && ($arg[2] == 'edit' || $arg[2] == 'delete')) { |
35 | - $section = 'node-' . $arg[2]; |
|
35 | + $section = 'node-'.$arg[2]; |
|
36 | 36 | } |
37 | 37 | } |
38 | - $variables['attributes']['class'][] = Html::getClass('section-' . $section); |
|
38 | + $variables['attributes']['class'][] = Html::getClass('section-'.$section); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | // Store the menu item since it has some useful information. |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | /** @var Drupal\migrate_source_csv\CSVFileObject $iterator */ |
28 | 28 | $iterator = $source->initializeIterator(); |
29 | - $filename = $iterator->getPath() . '/' . $iterator->getFilename(); |
|
29 | + $filename = $iterator->getPath().'/'.$iterator->getFilename(); |
|
30 | 30 | |
31 | 31 | /** @var \Drupal\migrate\Plugin\migrate\destination\EntityContentBase $destination_plugin */ |
32 | 32 | $destination_plugin = $migration->getDestinationPlugin(); |
@@ -41,8 +41,7 @@ discard block |
||
41 | 41 | // Prefer UUIDs to other fields. |
42 | 42 | if (in_array('UUID', $ids, TRUE)) { |
43 | 43 | $id_map = ['uuid', 'UUID']; |
44 | - } |
|
45 | - else { |
|
44 | + } else { |
|
46 | 45 | foreach ($processes as $field => $process) { |
47 | 46 | if (isset($process[0]['source']) && $process[0]['source'] == $ids[0]) { |
48 | 47 | $id_map = [$field, $ids[0]]; |
@@ -59,8 +58,7 @@ discard block |
||
59 | 58 | // Create a migrate executable, which we use later to set row values. |
60 | 59 | if (function_exists('drush_log')) { |
61 | 60 | $log = new DrushLogMigrateMessage(); |
62 | - } |
|
63 | - else { |
|
61 | + } else { |
|
64 | 62 | $log = new MigrateMessage(); |
65 | 63 | } |
66 | 64 | |
@@ -106,8 +104,7 @@ discard block |
||
106 | 104 | if (!$entity->hasTranslation($langcode)) { |
107 | 105 | $entity_values = $entity->toArray(); |
108 | 106 | $translation = $entity->addTranslation($langcode, $entity_values); |
109 | - } |
|
110 | - else { |
|
107 | + } else { |
|
111 | 108 | $translation = $entity->getTranslation($langcode); |
112 | 109 | } |
113 | 110 |