@@ -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 | } |
@@ -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(); |
@@ -153,8 +153,8 @@ |
||
| 153 | 153 | && $entity->hasField($image_field) |
| 154 | 154 | ) { |
| 155 | 155 | $id = $entity->get($unsplash_field)->value; |
| 156 | - $raw_image = file_get_contents('unsplash://' . $id); |
|
| 157 | - $filename = $id . '.jpg'; |
|
| 156 | + $raw_image = file_get_contents('unsplash://'.$id); |
|
| 157 | + $filename = $id.'.jpg'; |
|
| 158 | 158 | $images_dir = "public://images"; |
| 159 | 159 | if (!is_dir($images_dir)) { |
| 160 | 160 | mkdir($images_dir); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | // Append the prefix before buildRegions. |
| 44 | - $build['landing-top']['#prefix'] = '<div class="landing-display-' . $class . ' container-fluid">'; |
|
| 44 | + $build['landing-top']['#prefix'] = '<div class="landing-display-'.$class.' container-fluid">'; |
|
| 45 | 45 | |
| 46 | 46 | // Build the regions via PageBlockDisplayVariant::buildRegions. |
| 47 | 47 | $build = parent::buildRegions($build); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | continue; |
| 53 | 53 | } |
| 54 | 54 | $region_name = Html::getClass("block-region-$region"); |
| 55 | - $build[$region]['#prefix'] = '<div class="' . $region_name . ' row">'; |
|
| 55 | + $build[$region]['#prefix'] = '<div class="'.$region_name.' row">'; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // Add suffix for wrapper after buildRegions. |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | * @return \Robo\Contract\TaskInterface |
| 40 | 40 | * The task to execute. |
| 41 | 41 | */ |
| 42 | - public function configureBehat ($base_url = NULL) { |
|
| 42 | + public function configureBehat($base_url = NULL) { |
|
| 43 | 43 | $configuration = []; |
| 44 | 44 | |
| 45 | 45 | /** @var Finder $partials */ |
@@ -56,12 +56,12 @@ |
||
| 56 | 56 | $build = array(); |
| 57 | 57 | global $base_url; |
| 58 | 58 | header('Content-Type: application/json'); |
| 59 | - $json_output = (string) $this->httpClient->get($base_url . '/api/node/article')->getBody(); |
|
| 59 | + $json_output = (string) $this->httpClient->get($base_url.'/api/node/article')->getBody(); |
|
| 60 | 60 | $json_pretty = json_encode(json_decode($json_output), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
| 61 | 61 | $json_indented_by_2 = preg_replace('/^( +?)\\1(?=[^ ])/m', '$1', $json_pretty); |
| 62 | 62 | $build['article_node_endpoint_block']['#markup'] = '<a class="btn btn-primary coh-style-link-button open-apiModal" href="#open">Expand API Response</a> |
| 63 | - <div class="apiResponse"><pre><code class="language-json">' . $json_indented_by_2 . '</code></pre></div> |
|
| 64 | - <div class="apiResponseModal"><pre><code class="language-json">' . $json_indented_by_2 . '</code></pre></div>'; |
|
| 63 | + <div class="apiResponse"><pre><code class="language-json">' . $json_indented_by_2.'</code></pre></div> |
|
| 64 | + <div class="apiResponseModal"><pre><code class="language-json">' . $json_indented_by_2.'</code></pre></div>'; |
|
| 65 | 65 | $build['article_node_endpoint_block']['#attached']['library'][] = 'df_tools_articles/main'; |
| 66 | 66 | return $build; |
| 67 | 67 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | return; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $config = \Drupal::configFactory()->getEditable('color.theme.' . $theme); |
|
| 54 | + $config = \Drupal::configFactory()->getEditable('color.theme.'.$theme); |
|
| 55 | 55 | |
| 56 | 56 | // Resolve palette. |
| 57 | 57 | if ($scheme != '') { |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | // Make sure enough memory is available. |
| 67 | 67 | if (isset($info['base_image'])) { |
| 68 | 68 | // Fetch source image dimensions. |
| 69 | - $source = drupal_get_path('theme', $theme) . '/' . $info['base_image']; |
|
| 69 | + $source = drupal_get_path('theme', $theme).'/'.$info['base_image']; |
|
| 70 | 70 | list($width, $height) = getimagesize($source); |
| 71 | 71 | |
| 72 | 72 | // We need at least a copy of the source and a target buffer of the same |
@@ -104,28 +104,28 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | // Prepare target locations for generated files. |
| 107 | - $id = $theme . '-' . substr(hash('sha256', serialize($palette) . microtime()), 0, 8); |
|
| 107 | + $id = $theme.'-'.substr(hash('sha256', serialize($palette).microtime()), 0, 8); |
|
| 108 | 108 | $paths['color'] = 'public://color'; |
| 109 | - $paths['target'] = $paths['color'] . '/' . $id; |
|
| 109 | + $paths['target'] = $paths['color'].'/'.$id; |
|
| 110 | 110 | foreach ($paths as $path) { |
| 111 | 111 | \Drupal::service('file_system')->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY); |
| 112 | 112 | } |
| 113 | - $paths['target'] = $paths['target'] . '/'; |
|
| 113 | + $paths['target'] = $paths['target'].'/'; |
|
| 114 | 114 | $paths['id'] = $id; |
| 115 | - $paths['source'] = drupal_get_path('theme', $theme) . '/'; |
|
| 115 | + $paths['source'] = drupal_get_path('theme', $theme).'/'; |
|
| 116 | 116 | $paths['files'] = $paths['map'] = array(); |
| 117 | 117 | |
| 118 | 118 | // Save palette and logo location. |
| 119 | 119 | $config |
| 120 | 120 | ->set('palette', $palette) |
| 121 | - ->set('logo', $paths['target'] . 'logo.svg') |
|
| 121 | + ->set('logo', $paths['target'].'logo.svg') |
|
| 122 | 122 | ->save(); |
| 123 | 123 | |
| 124 | 124 | // Copy over neutral images. |
| 125 | 125 | foreach ($info['copy'] as $file) { |
| 126 | 126 | $base = drupal_basename($file); |
| 127 | - $source = $paths['source'] . $file; |
|
| 128 | - $filepath = file_unmanaged_copy($source, $paths['target'] . $base); |
|
| 127 | + $source = $paths['source'].$file; |
|
| 128 | + $filepath = file_unmanaged_copy($source, $paths['target'].$base); |
|
| 129 | 129 | $paths['map'][$file] = $base; |
| 130 | 130 | $paths['files'][] = $filepath; |
| 131 | 131 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | foreach ($info['css'] as $stylesheet) { |
| 141 | 141 | // Build a temporary array with CSS files. |
| 142 | 142 | $files = array(); |
| 143 | - if (file_exists($paths['source'] . $stylesheet)) { |
|
| 143 | + if (file_exists($paths['source'].$stylesheet)) { |
|
| 144 | 144 | $files[] = $stylesheet; |
| 145 | 145 | } |
| 146 | 146 | |
@@ -149,11 +149,11 @@ discard block |
||
| 149 | 149 | // Aggregate @imports recursively for each configured top level CSS file |
| 150 | 150 | // without optimization. Aggregation and optimization will be |
| 151 | 151 | // handled by drupal_build_css_cache() only. |
| 152 | - $style = $css_optimizer->loadFile($paths['source'] . $file, FALSE); |
|
| 152 | + $style = $css_optimizer->loadFile($paths['source'].$file, FALSE); |
|
| 153 | 153 | |
| 154 | 154 | // Return the path to where this CSS file originated from, stripping |
| 155 | 155 | // off the name of the file at the end of the path. |
| 156 | - $css_optimizer->rewriteFileURIBasePath = base_path() . dirname($paths['source'] . $file) . '/'; |
|
| 156 | + $css_optimizer->rewriteFileURIBasePath = base_path().dirname($paths['source'].$file).'/'; |
|
| 157 | 157 | |
| 158 | 158 | // Prefix all paths within this CSS file, ignoring absolute paths. |
| 159 | 159 | $style = preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', array($css_optimizer, 'rewriteFileURI'), $style); |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | // Rewrite stylesheet with new colors. |
| 162 | 162 | $style = _df_tools_color_color_rewrite_stylesheet($theme, $info, $paths, $palette, $style); |
| 163 | 163 | $base_file = drupal_basename($file); |
| 164 | - $css[] = $paths['target'] . $base_file; |
|
| 165 | - _color_save_stylesheet($paths['target'] . $base_file, $style, $paths); |
|
| 164 | + $css[] = $paths['target'].$base_file; |
|
| 165 | + _color_save_stylesheet($paths['target'].$base_file, $style, $paths); |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | // Convert placeholder ids to the format we handle. |
| 220 | 220 | foreach ($palette_template as $color_id => $color_placeholder) { |
| 221 | - $palette_template[$color_id] = '#__' . Html::cleanCssIdentifier((string) $color_placeholder, $filter) . '__'; |
|
| 221 | + $palette_template[$color_id] = '#__'.Html::cleanCssIdentifier((string) $color_placeholder, $filter).'__'; |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | return $palette_template; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | |
| 294 | 294 | // Replace paths to images. |
| 295 | 295 | foreach ($paths['map'] as $before => $after) { |
| 296 | - $before = base_path() . $paths['source'] . $before; |
|
| 296 | + $before = base_path().$paths['source'].$before; |
|
| 297 | 297 | $before = preg_replace('`(^|/)(?!../)([^/]+)/../`', '$1', $before); |
| 298 | 298 | $output = str_replace($before, $after, $output); |
| 299 | 299 | } |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | // Don't show this element in the context of an admin menu. |
| 57 | 57 | if (!isset($form['admin_label'])) { |
| 58 | 58 | $form['value']['#suffix'] = |
| 59 | - '<a class="simple-proximity-location-button button" title="' . $this->t('Use your current location') . '">' . |
|
| 60 | - ' <i class="fa fa-map-marker" aria-hidden="true"></i>' . |
|
| 61 | - '</a>' . $form['value']['#suffix']; |
|
| 59 | + '<a class="simple-proximity-location-button button" title="'.$this->t('Use your current location').'">'. |
|
| 60 | + ' <i class="fa fa-map-marker" aria-hidden="true"></i>'. |
|
| 61 | + '</a>'.$form['value']['#suffix']; |
|
| 62 | 62 | $form['value']['#attached'] = ['library' => ['df_tools_map/main']]; |
| 63 | 63 | } |
| 64 | 64 | } |
@@ -109,15 +109,15 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | // Geocode the location if it's present. |
| 111 | 111 | if (!empty($location)) { |
| 112 | - if ($collection = \Drupal::service('geocoder')->geocode($location,['googlemaps'])) { |
|
| 112 | + if ($collection = \Drupal::service('geocoder')->geocode($location, ['googlemaps'])) { |
|
| 113 | 113 | $coordinates = $collection->first()->getCoordinates(); |
| 114 | 114 | |
| 115 | 115 | // Generate a distance formula programatically. |
| 116 | 116 | $haversine_options = [ |
| 117 | 117 | 'origin_latitude' => $coordinates->getLatitude(), |
| 118 | 118 | 'origin_longitude' => $coordinates->getLongitude(), |
| 119 | - 'destination_latitude' => $this->table . '.' . $this->realField . '_lat', |
|
| 120 | - 'destination_longitude' => $this->table . '.' . $this->realField . '_lon', |
|
| 119 | + 'destination_latitude' => $this->table.'.'.$this->realField.'_lat', |
|
| 120 | + 'destination_longitude' => $this->table.'.'.$this->realField.'_lon', |
|
| 121 | 121 | 'earth_radius' => GEOFIELD_KILOMETERS, |
| 122 | 122 | ]; |
| 123 | 123 | |
@@ -125,13 +125,13 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | /** @var \Drupal\views\Plugin\views\query\Sql $query */ |
| 127 | 127 | $query = $this->query; |
| 128 | - $query->addOrderBy(NULL, $formula, 'ASC', $this->table . '_simple_proximity'); |
|
| 128 | + $query->addOrderBy(NULL, $formula, 'ASC', $this->table.'_simple_proximity'); |
|
| 129 | 129 | |
| 130 | 130 | // Add a where expression if a distance is used. |
| 131 | 131 | if ($this->options['expose']['distance']) { |
| 132 | 132 | $distance = $this->options['expose']['distance']; |
| 133 | - $placeholder = $query->placeholder($this->table . '_simple_proximity'); |
|
| 134 | - $query->addWhereExpression(0, '(' . $formula . ' <= ' . $placeholder . ')', [$placeholder => $distance]); |
|
| 133 | + $placeholder = $query->placeholder($this->table.'_simple_proximity'); |
|
| 134 | + $query->addWhereExpression(0, '('.$formula.' <= '.$placeholder.')', [$placeholder => $distance]); |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | } |
@@ -150,10 +150,10 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | foreach ($options as $key => $option) { |
| 152 | 152 | if (is_numeric($option)) { |
| 153 | - $formula = str_replace(':' . $key, $option, $formula); |
|
| 153 | + $formula = str_replace(':'.$key, $option, $formula); |
|
| 154 | 154 | } |
| 155 | 155 | else { |
| 156 | - $formula = str_replace(':' . $key, $connection->escapeField($option), $formula); |
|
| 156 | + $formula = str_replace(':'.$key, $connection->escapeField($option), $formula); |
|
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | |