@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $icon = $build[$field_name]['#object']->field_icon->getString(); |
30 | 30 | if (!empty($icon)) { |
31 | 31 | $wrapper['#children'][$field_name] = [ |
32 | - '#markup' => '<i class="fa ' . $icon . ' hero-icon"></i>', |
|
32 | + '#markup' => '<i class="fa '.$icon.' hero-icon"></i>', |
|
33 | 33 | '#allowed_tags' => ['i'], |
34 | 34 | ]; |
35 | 35 | } |
@@ -43,13 +43,13 @@ discard block |
||
43 | 43 | // Attach styles. |
44 | 44 | $alignment = $entity->get('field_hero_alignment')->getString(); |
45 | 45 | if (preg_match('/^[a-z_]+$/i', $alignment)) { |
46 | - $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('hero-block-align-' . $alignment); |
|
46 | + $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('hero-block-align-'.$alignment); |
|
47 | 47 | } |
48 | 48 | $color_regex = '/^#[0-9a-f]{6}$/i'; |
49 | 49 | $text_color = $entity->get('field_text_color')->getString(); |
50 | 50 | if (preg_match($color_regex, $text_color)) { |
51 | - $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
52 | - $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
51 | + $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: '.$text_color; |
|
52 | + $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: '.$text_color; |
|
53 | 53 | } |
54 | 54 | $gradient_color = $entity->get('field_gradient_color')->getString(); |
55 | 55 | if (preg_match($color_regex, $gradient_color)) { |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | } |
69 | 69 | $callout_color = $entity->get('field_callout_color')->getString(); |
70 | 70 | if (preg_match($color_regex, $callout_color)) { |
71 | - $style = 'background-color: ' . $callout_color . ';'; |
|
71 | + $style = 'background-color: '.$callout_color.';'; |
|
72 | 72 | $hex = trim($callout_color, '#'); |
73 | - $r = hexdec(substr($hex,0,2)); |
|
74 | - $g = hexdec(substr($hex,2,2)); |
|
75 | - $b = hexdec(substr($hex,4,2)); |
|
73 | + $r = hexdec(substr($hex, 0, 2)); |
|
74 | + $g = hexdec(substr($hex, 2, 2)); |
|
75 | + $b = hexdec(substr($hex, 4, 2)); |
|
76 | 76 | if ($r + $g + $b > 382) { |
77 | 77 | $wrapper['#children']['field_hero_link'][0]['#attributes']['class'][] = 'hero-link-light-bg'; |
78 | 78 | $style .= 'border-color:black;color:black;'; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | if (isset($variables['elements']['content']) && isset($variables['elements']['content']['#block_content'])) { |
99 | 99 | /** @var \Drupal\block_content\Entity\BlockContent $entity */ |
100 | 100 | $entity = $variables['elements']['content']['#block_content']; |
101 | - $suggestions[] = 'block__block_content__' . $entity->bundle(); |
|
101 | + $suggestions[] = 'block__block_content__'.$entity->bundle(); |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | // Set up the correct pa$th for the CSV files in this module. |
271 | 271 | $types = ['hero', 'media']; |
272 | 272 | foreach ($types as $type) { |
273 | - $id = 'import_block_' . $type; |
|
273 | + $id = 'import_block_'.$type; |
|
274 | 274 | $definitions[$id]['source']['path'] = str_replace('..', dirname(__FILE__), $definitions[$id]['source']['path']); |
275 | 275 | } |
276 | 276 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | // 'Current @Entity_Type' category. If the block is not a field on the |
315 | 315 | // current entity, allow its category to be remapped. |
316 | 316 | if ($category == '@entity') { |
317 | - $block_info[$key]['category'] = $info['category']->render() . ' Fields'; |
|
317 | + $block_info[$key]['category'] = $info['category']->render().' Fields'; |
|
318 | 318 | } |
319 | 319 | // Place Block Content entities into categories based on their type. |
320 | 320 | else if ($category == 'Custom') { |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | if ($entity = $entity_type_manager->getStorage($entity_type)->load($id)) { |
359 | 359 | foreach ($block_info as $key => $info) { |
360 | 360 | if ($info['id'] === 'entity_field') { |
361 | - list($block_id,$block_entity_type,$field_name) = explode(':', $info['plugin_id']); |
|
361 | + list($block_id, $block_entity_type, $field_name) = explode(':', $info['plugin_id']); |
|
362 | 362 | if ($block_entity_type !== $entity_type || ($entity instanceof FieldableEntityInterface && !$entity->hasField($field_name))) { |
363 | 363 | unset($block_info[$key]); |
364 | 364 | } |
@@ -48,8 +48,7 @@ discard block |
||
48 | 48 | ]; |
49 | 49 | } |
50 | 50 | unset($build[$field_name]); |
51 | - } |
|
52 | - else if ($field_name != 'field_hero_image') { |
|
51 | + } else if ($field_name != 'field_hero_image') { |
|
53 | 52 | $wrapper['#children'][$field_name] = $build[$field_name]; |
54 | 53 | unset($build[$field_name]); |
55 | 54 | } |
@@ -90,8 +89,7 @@ discard block |
||
90 | 89 | if ($r + $g + $b > 382) { |
91 | 90 | $wrapper['#children']['field_hero_link'][0]['#attributes']['class'][] = 'hero-link-light-bg'; |
92 | 91 | $style .= 'border-color:black;color:black;'; |
93 | - } |
|
94 | - else { |
|
92 | + } else { |
|
95 | 93 | $wrapper['#children']['field_hero_link'][0]['#attributes']['class'][] = 'hero-link-dark-bg'; |
96 | 94 | $style .= 'border-color:white;color:white;'; |
97 | 95 | } |
@@ -202,8 +200,7 @@ discard block |
||
202 | 200 | unset($form['flipper']['front']['settings']['view_mode']['#options'][$view_mode]); |
203 | 201 | } |
204 | 202 | } |
205 | - } |
|
206 | - else if ($form['plugin_id']['#value'] == 'media_embed') { |
|
203 | + } else if ($form['plugin_id']['#value'] == 'media_embed') { |
|
207 | 204 | if (empty(Element::getVisibleChildren($form['flipper']['front']['settings']['selection']['table'])) && !$form_state->isProcessingInput()) { |
208 | 205 | $form['#attached']['library'][] = 'df_tools_blocks/auto_open'; |
209 | 206 | $form['#attributes']['data-df-tools-blocks-auto-open'] = 'settings_selection_mids_entity_browser'; |
@@ -367,14 +364,12 @@ discard block |
||
367 | 364 | if (isset($block_info[$key])) { |
368 | 365 | if (isset($category_map[$category])) { |
369 | 366 | $block_info[$key]['category'] = t($category_map[$category]); |
370 | - } |
|
371 | - else if (is_string($block_info[$key]['category'])) { |
|
367 | + } else if (is_string($block_info[$key]['category'])) { |
|
372 | 368 | $block_info[$key]['category'] = t($block_info[$key]['category']); |
373 | 369 | } |
374 | 370 | if (isset($label_map[$label])) { |
375 | 371 | $block_info[$key]['label'] = $label_map[$label]; |
376 | - } |
|
377 | - else if (is_string($block_info[$key]['label'])) { |
|
372 | + } else if (is_string($block_info[$key]['label'])) { |
|
378 | 373 | $block_info[$key]['label'] = t($block_info[$key]['label']); |
379 | 374 | } |
380 | 375 | } |
@@ -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 | } |
@@ -23,13 +23,13 @@ |
||
23 | 23 | $anchor_id = Html::getUniqueId('df-tools-anchor'); |
24 | 24 | $build = [ |
25 | 25 | '#markup' => |
26 | - '<div id="' . $anchor_id . '"></div>' . |
|
27 | - '<div data-sticky-container class="df-tools-magellan-block hide-for-small-only full-width-row">' . |
|
28 | - ' <div class="sticky" data-sticky data-top-anchor="' . $anchor_id . '" data-margin-top="0">' . |
|
29 | - ' <nav data-magellan data-active-class="active">' . |
|
30 | - ' <ul class="horizontal menu expanded"></ul>' . |
|
31 | - ' </nav>' . |
|
32 | - ' </div>' . |
|
26 | + '<div id="'.$anchor_id.'"></div>'. |
|
27 | + '<div data-sticky-container class="df-tools-magellan-block hide-for-small-only full-width-row">'. |
|
28 | + ' <div class="sticky" data-sticky data-top-anchor="'.$anchor_id.'" data-margin-top="0">'. |
|
29 | + ' <nav data-magellan data-active-class="active">'. |
|
30 | + ' <ul class="horizontal menu expanded"></ul>'. |
|
31 | + ' </nav>'. |
|
32 | + ' </div>'. |
|
33 | 33 | '</div>' |
34 | 34 | ]; |
35 | 35 |
@@ -20,19 +20,19 @@ |
||
20 | 20 | 'render element' => 'content', |
21 | 21 | 'base hook' => 'node', |
22 | 22 | 'template' => 'node--cta', |
23 | - 'path' => drupal_get_path('module', 'df_tools_cta') . '/templates', |
|
23 | + 'path' => drupal_get_path('module', 'df_tools_cta').'/templates', |
|
24 | 24 | ); |
25 | 25 | $theme['node__cta__callout'] = array( |
26 | 26 | 'render element' => 'content', |
27 | 27 | 'base hook' => 'node', |
28 | 28 | 'template' => 'node--cta--callout', |
29 | - 'path' => drupal_get_path('module', 'df_tools_cta') . '/templates', |
|
29 | + 'path' => drupal_get_path('module', 'df_tools_cta').'/templates', |
|
30 | 30 | ); |
31 | 31 | $theme['node__cta__notification'] = array( |
32 | 32 | 'render element' => 'content', |
33 | 33 | 'base hook' => 'node', |
34 | 34 | 'template' => 'node--cta--notification', |
35 | - 'path' => drupal_get_path('module', 'df_tools_cta') . '/templates', |
|
35 | + 'path' => drupal_get_path('module', 'df_tools_cta').'/templates', |
|
36 | 36 | ); |
37 | 37 | return $theme; |
38 | 38 | } |
@@ -20,8 +20,8 @@ |
||
20 | 20 | ->getStorage('file')->loadByProperties(['filename' => $image]); |
21 | 21 | |
22 | 22 | if (empty($files)) { |
23 | - $base_path = dirname($this->configuration['path']) . '/images/'; |
|
24 | - $path = $base_path . $image; |
|
23 | + $base_path = dirname($this->configuration['path']).'/images/'; |
|
24 | + $path = $base_path.$image; |
|
25 | 25 | $data = file_get_contents($path); |
26 | 26 | $uri = file_build_uri($image); |
27 | 27 | $file = file_save_data($data, $uri); |
@@ -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 |
@@ -1,7 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -use Drupal\user\Entity\User; |
|
4 | - |
|
5 | 3 | /** |
6 | 4 | * @file |
7 | 5 | * Contains core functionality for the DF distribution. |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | /** @var Drupal\migrate_source_csv\CSVFileObject $iterator */ |
23 | 23 | $iterator = $source->initializeIterator(); |
24 | 24 | $base_path = $iterator->getPath(); |
25 | - $filename = $base_path . '/' . $iterator->getFilename(); |
|
25 | + $filename = $base_path.'/'.$iterator->getFilename(); |
|
26 | 26 | |
27 | 27 | $destination = $migration->getDestinationPlugin(); |
28 | 28 | $entity_type = explode(':', $destination->getPluginId())[1]; |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | $entity = $entity_storage->load($id); |
74 | 74 | |
75 | 75 | // See if a Panelizer config file exists for this Node. |
76 | - $panels_file = $base_path . '/panelizer.panels_display.' . $entity_type . '.' . $entity->uuid() . '.yml'; |
|
76 | + $panels_file = $base_path.'/panelizer.panels_display.'.$entity_type.'.'.$entity->uuid().'.yml'; |
|
77 | 77 | if (file_exists($panels_file) && isset($entity->panelizer)) { |
78 | 78 | $yaml = file_get_contents($panels_file); |
79 | 79 | |
80 | 80 | $panels_display = Yaml::parse($yaml); |
81 | 81 | |
82 | 82 | // The storage ID isn't based on UUIDs, unfortunately. Hotswap it with current info. |
83 | - $panels_display['storage_id'] = $entity_type . ':' . $entity->id() . ':full:' . $entity->getRevisionId(); |
|
83 | + $panels_display['storage_id'] = $entity_type.':'.$entity->id().':full:'.$entity->getRevisionId(); |
|
84 | 84 | |
85 | 85 | // Set the Panels Display to match what's defined in YAML. |
86 | 86 | $entity->panelizer->panels_display = $panels_display; |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | } |
44 | 44 | else { |
45 | 45 | foreach ($value as $j) { |
46 | - $output[] = $this->keysToString($keys) . '[] = ' . $j; |
|
46 | + $output[] = $this->keysToString($keys).'[] = '.$j; |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | } |
50 | 50 | else { |
51 | - $output[] = $this->keysToString($keys) . ' = ' . $value; |
|
51 | + $output[] = $this->keysToString($keys).' = '.$value; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | array_pop($keys); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | protected function keysToString(array $keys) { |
70 | 70 | $head = array_shift($keys); |
71 | 71 | if ($keys) { |
72 | - return $head . '[' . implode('][', $keys) . ']'; |
|
72 | + return $head.'['.implode('][', $keys).']'; |
|
73 | 73 | } |
74 | 74 | else { |
75 | 75 | return $head; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | foreach (['key', 'value1', 'value2', 'value3'] as $var) { |
124 | 124 | $$var = isset($match[++$i]) ? $match[$i] : ''; |
125 | 125 | } |
126 | - $value = stripslashes(substr($value1, 1, -1)) . stripslashes(substr($value2, 1, -1)) . $value3; |
|
126 | + $value = stripslashes(substr($value1, 1, -1)).stripslashes(substr($value2, 1, -1)).$value3; |
|
127 | 127 | |
128 | 128 | // Parse array syntax. |
129 | 129 | $keys = preg_split('/\]?\[/', rtrim($key, ']')); |
@@ -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 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | /** @var \Composer\Package\Link $package */ |
29 | 29 | foreach ($patched_dependencies as $package) { |
30 | 30 | if (static::packageIsUnpinned($package)) { |
31 | - $error[] = $package->getTarget() . ': ' . $package->getPrettyConstraint(); |
|
31 | + $error[] = $package->getTarget().': '.$package->getPrettyConstraint(); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | if (!empty($error)) { |
@@ -35,8 +35,7 @@ |
||
35 | 35 | array_unshift($error, 'The following dependencies are patched but don\'t have pinned dependency constraints:'); |
36 | 36 | $event->getIO()->writeError($error); |
37 | 37 | return FALSE; |
38 | - } |
|
39 | - else { |
|
38 | + } else { |
|
40 | 39 | $event->getIO()->write('Patched dependencies have constraints that are properly pinned.'); |
41 | 40 | } |
42 | 41 | } |