@@ -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")) { |
@@ -181,11 +181,11 @@ |
||
| 181 | 181 | // Check if this field is an Address field. |
| 182 | 182 | if (isset($address['address_line1'])) { |
| 183 | 183 | // Format the address as a single string. |
| 184 | - $string .= $address['address_line1'] . "\n"; |
|
| 185 | - $string .= !empty($address['address_line2']) ? $address['address_line2'] . "\n" : ''; |
|
| 186 | - $string .= $address['locality'] . ', '; |
|
| 187 | - $string .= str_replace('US-', '', $address['administrative_area']) . ' '; |
|
| 188 | - $string .= $address['postal_code'] . "\n"; |
|
| 184 | + $string .= $address['address_line1']."\n"; |
|
| 185 | + $string .= !empty($address['address_line2']) ? $address['address_line2']."\n" : ''; |
|
| 186 | + $string .= $address['locality'].', '; |
|
| 187 | + $string .= str_replace('US-', '', $address['administrative_area']).' '; |
|
| 188 | + $string .= $address['postal_code']."\n"; |
|
| 189 | 189 | $string .= $address['country_code']; |
| 190 | 190 | } |
| 191 | 191 | |
@@ -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'] = [ |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | $image_names = explode(',', $images); |
| 20 | 20 | $files = []; |
| 21 | 21 | foreach ($image_names as $image_name) { |
| 22 | - $path = dirname($this->configuration['path']) . '/images/' . $image_name; |
|
| 22 | + $path = dirname($this->configuration['path']).'/images/'.$image_name; |
|
| 23 | 23 | $data = file_get_contents($path); |
| 24 | 24 | $uri = file_build_uri($image_name); |
| 25 | 25 | $files[] = file_save_data($data, $uri); |
@@ -11,14 +11,14 @@ |
||
| 11 | 11 | function df_tools_gallery_library_info_alter(&$libraries, $extension) { |
| 12 | 12 | // Optionally use the Libraries module to determine our library paths. |
| 13 | 13 | if ($extension == 'df_tools_gallery' && \Drupal::moduleHandler()->moduleExists('libraries')) { |
| 14 | - $imagesloaded_path = libraries_get_path('imagesloaded') . '/imagesloaded.pkgd.min.js'; |
|
| 15 | - $masonry_path = libraries_get_path('masonry') . '/dist/masonry.pkgd.min.js'; |
|
| 14 | + $imagesloaded_path = libraries_get_path('imagesloaded').'/imagesloaded.pkgd.min.js'; |
|
| 15 | + $masonry_path = libraries_get_path('masonry').'/dist/masonry.pkgd.min.js'; |
|
| 16 | 16 | $lightbox2_path = libraries_get_path('lightbox2'); |
| 17 | 17 | |
| 18 | - $libraries['lightbox2']['css']['theme'] = ['/' . $lightbox2_path . '/dist/css/lightbox.min.css' => []]; |
|
| 19 | - $libraries['lightbox2']['js'] = ['/' . $lightbox2_path . '/dist/js/lightbox.min.js' => ['minified' => 'true']]; |
|
| 20 | - $libraries['imagesloaded']['js'] = ['/' . $imagesloaded_path => ['minified' => 'true']]; |
|
| 21 | - $libraries['masonry']['js'] = ['/' . $masonry_path => ['minified' => 'true']]; |
|
| 18 | + $libraries['lightbox2']['css']['theme'] = ['/'.$lightbox2_path.'/dist/css/lightbox.min.css' => []]; |
|
| 19 | + $libraries['lightbox2']['js'] = ['/'.$lightbox2_path.'/dist/js/lightbox.min.js' => ['minified' => 'true']]; |
|
| 20 | + $libraries['imagesloaded']['js'] = ['/'.$imagesloaded_path => ['minified' => 'true']]; |
|
| 21 | + $libraries['masonry']['js'] = ['/'.$masonry_path => ['minified' => 'true']]; |
|
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |
@@ -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 | |
@@ -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; |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | if (!empty($settings)) { |
| 211 | 211 | // Use the Type Style color as the button's background color. |
| 212 | 212 | if (!empty($settings['color'])) { |
| 213 | - $build['actions']['quick_draft_form'][$id]['#attributes']['style'] = 'background-color: ' . $settings['color']; |
|
| 213 | + $build['actions']['quick_draft_form'][$id]['#attributes']['style'] = 'background-color: '.$settings['color']; |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | // Add the Type Style icon to the button. |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | '#type' => 'container', |
| 220 | 220 | $build['actions']['quick_draft_form'][$id], |
| 221 | 221 | [ |
| 222 | - '#markup' => '<i class="material-icons">' . $settings['icon'] . '</i>' |
|
| 222 | + '#markup' => '<i class="material-icons">'.$settings['icon'].'</i>' |
|
| 223 | 223 | ], |
| 224 | 224 | '#attributes' => [ |
| 225 | 225 | 'class' => ['moderation-sidebar-button-wrapper'], |
@@ -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 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $wrapper = [ |
| 79 | - '#prefix' => '<div class="container"><div class="row ' . $hero_alignment . '">', |
|
| 79 | + '#prefix' => '<div class="container"><div class="row '.$hero_alignment.'">', |
|
| 80 | 80 | '#suffix' => '</div></div>', |
| 81 | 81 | '#type' => 'container', |
| 82 | 82 | '#weight' => -1, |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $icon = $build[$field_name]['#object']->field_icon->getString(); |
| 91 | 91 | if (!empty($icon)) { |
| 92 | 92 | $wrapper['#children'][$field_name] = [ |
| 93 | - '#markup' => '<i class="fa ' . $icon . ' hero-icon"></i>', |
|
| 93 | + '#markup' => '<i class="fa '.$icon.' hero-icon"></i>', |
|
| 94 | 94 | '#allowed_tags' => ['i'], |
| 95 | 95 | ]; |
| 96 | 96 | } |
@@ -104,13 +104,13 @@ discard block |
||
| 104 | 104 | // Attach styles. |
| 105 | 105 | $alignment = $entity->get('field_hero_alignment')->getString(); |
| 106 | 106 | if (preg_match('/^[a-z_]+$/i', $alignment)) { |
| 107 | - $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('hero-block-align-' . $alignment); |
|
| 107 | + $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('hero-block-align-'.$alignment); |
|
| 108 | 108 | } |
| 109 | 109 | $color_regex = '/^#[0-9a-f]{6}$/i'; |
| 110 | 110 | $text_color = $entity->get('field_text_color')->getString(); |
| 111 | 111 | if (preg_match($color_regex, $text_color)) { |
| 112 | - $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
| 113 | - $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
| 112 | + $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: '.$text_color; |
|
| 113 | + $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: '.$text_color; |
|
| 114 | 114 | } |
| 115 | 115 | $gradient_color = $entity->get('field_gradient_color')->getString(); |
| 116 | 116 | if (preg_match($color_regex, $gradient_color)) { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | } |
| 132 | 132 | $callout_color = $entity->get('field_callout_color')->getString(); |
| 133 | 133 | if (preg_match($color_regex, $callout_color)) { |
| 134 | - $style = 'background-color: ' . $callout_color . ';'; |
|
| 134 | + $style = 'background-color: '.$callout_color.';'; |
|
| 135 | 135 | $hex = trim($callout_color, '#'); |
| 136 | 136 | $r = hexdec(substr($hex, 0, 2)); |
| 137 | 137 | $g = hexdec(substr($hex, 2, 2)); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | if (isset($variables['elements']['content']) && isset($variables['elements']['content']['#block_content'])) { |
| 185 | 185 | /** @var \Drupal\block_content\Entity\BlockContent $entity */ |
| 186 | 186 | $entity = $variables['elements']['content']['#block_content']; |
| 187 | - $suggestions[] = 'block__block_content__' . $entity->bundle(); |
|
| 187 | + $suggestions[] = 'block__block_content__'.$entity->bundle(); |
|
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | // Set up the correct pa$th for the CSV files in this module. |
| 373 | 373 | $types = ['hero', 'media']; |
| 374 | 374 | foreach ($types as $type) { |
| 375 | - $id = 'import_block_' . $type; |
|
| 375 | + $id = 'import_block_'.$type; |
|
| 376 | 376 | $definitions[$id]['source']['path'] = str_replace('..', dirname(__FILE__), $definitions[$id]['source']['path']); |
| 377 | 377 | } |
| 378 | 378 | } |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | // 'Current @Entity_Type' category. If the block is not a field on the |
| 434 | 434 | // current entity, allow its category to be remapped. |
| 435 | 435 | if ($category === '@entity') { |
| 436 | - $block_info[$key]['category'] = $info['category']->render() . ' Fields'; |
|
| 436 | + $block_info[$key]['category'] = $info['category']->render().' Fields'; |
|
| 437 | 437 | } |
| 438 | 438 | // Place Block Content entities into categories based on their type. |
| 439 | 439 | elseif ($category === 'Custom') { |