@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | protected function setImageProperty(Row $row, $source_property) { |
35 | 35 | if ($value = $row->getSourceProperty($source_property)) { |
36 | - $path = dirname($this->configuration['path']) . '/images/' . $value; |
|
36 | + $path = dirname($this->configuration['path']).'/images/'.$value; |
|
37 | 37 | $data = file_get_contents($path); |
38 | 38 | $uri = file_build_uri($value); |
39 | 39 | $file = file_save_data($data, $uri); |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | // Point source path to local CSV file. |
37 | 37 | if ($local_csv === TRUE) { |
38 | - $migration['source']['path'] = $path . $prefix . "." . $entity_type . "." . $type . '.csv'; |
|
38 | + $migration['source']['path'] = $path.$prefix.".".$entity_type.".".$type.'.csv'; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | // Set content type to current bundle. |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | // Reset the library path to work around a bug with the Libraries module not |
24 | 24 | // incorporating the ['path'] when calling libraries_get_path(). |
25 | - $libraries['lite']['library path'] = libraries_get_path('lite') . '/' . $libraries['lite']['path']; |
|
25 | + $libraries['lite']['library path'] = libraries_get_path('lite').'/'.$libraries['lite']['path']; |
|
26 | 26 | |
27 | 27 | // Hardcode the version number because the raw source files do not contain |
28 | 28 | // any version information. |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | } |
77 | 77 | try { |
78 | 78 | $module_info = \Drupal::moduleHandler()->getModule($input); |
79 | - $destination_dir = DRUPAL_ROOT . '/' . $module_info->getPath() . '/config/install/'; |
|
80 | - $source = DRUPAL_ROOT . '/' . $destination_storage->getFilePath($config); |
|
79 | + $destination_dir = DRUPAL_ROOT.'/'.$module_info->getPath().'/config/install/'; |
|
80 | + $source = DRUPAL_ROOT.'/'.$destination_storage->getFilePath($config); |
|
81 | 81 | // Create /config/install directory if it does not exist. |
82 | 82 | if (!file_exists($destination_dir)) { |
83 | 83 | mkdir($destination_dir, 0755, true); |
84 | 84 | } |
85 | - $destination = $destination_dir . basename($source); |
|
85 | + $destination = $destination_dir.basename($source); |
|
86 | 86 | if (!copy($source, $destination)) { |
87 | 87 | drush_log(dt('New copy from @source to @destination failed.', ['@source' => $source, '@destination' => $destination]), LogLevel::ERROR); |
88 | 88 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | break; |
99 | 99 | case 'update': |
100 | 100 | foreach ($list as $config) { |
101 | - $source = DRUPAL_ROOT . '/' . $destination_storage->getFilePath($config); |
|
101 | + $source = DRUPAL_ROOT.'/'.$destination_storage->getFilePath($config); |
|
102 | 102 | |
103 | 103 | $instances = _df_tools_config_find_config_instances($destination_storage, $config); |
104 | 104 | $choice = drush_choice($instances, dt('Choose update destination for @config.', ['@config' => $config])); |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | |
153 | 153 | $iterator = new RecursiveDirectoryIterator(DRUPAL_ROOT, FilesystemIterator::FOLLOW_SYMLINKS); |
154 | 154 | $files = []; |
155 | - foreach(new RecursiveIteratorIterator($iterator) as $file){ |
|
156 | - if(strpos($file, $filename) !== FALSE && strpos($file, DRUPAL_ROOT . '/sites/') === FALSE){ |
|
155 | + foreach (new RecursiveIteratorIterator($iterator) as $file) { |
|
156 | + if (strpos($file, $filename) !== FALSE && strpos($file, DRUPAL_ROOT.'/sites/') === FALSE) { |
|
157 | 157 | $files[] = (string) $file; |
158 | 158 | } |
159 | 159 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | $form['description'] = [ |
29 | - '#markup' => '<p>' . t('Image derivatives can be created in bulk manually to remove the need for Drupal to create them on page load.') . '</p>', |
|
29 | + '#markup' => '<p>'.t('Image derivatives can be created in bulk manually to remove the need for Drupal to create them on page load.').'</p>', |
|
30 | 30 | ]; |
31 | 31 | $form['image_styles'] = [ |
32 | 32 | '#type' => 'checkboxes', |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | $file_pattern = "[^\/]*"; // Finds anything that does not contain "/", should be fine. |
56 | 56 | } |
57 | 57 | else { |
58 | - $file_pattern = $dir ? $dir . ".+" : ".+"; |
|
58 | + $file_pattern = $dir ? $dir.".+" : ".+"; |
|
59 | 59 | } |
60 | 60 | |
61 | - $regex = "^public:\/\/(" . $file_pattern . ")\.(" . implode($extensions, '|') . ")$"; |
|
61 | + $regex = "^public:\/\/(".$file_pattern.")\.(".implode($extensions, '|').")$"; |
|
62 | 62 | |
63 | 63 | // Query the database for files that match this pattern. |
64 | 64 | $query = db_select('file_managed', 'f') |
65 | - ->condition('filemime', $mimetypes , 'IN') |
|
65 | + ->condition('filemime', $mimetypes, 'IN') |
|
66 | 66 | ->condition('uri', $regex, 'REGEXP'); |
67 | 67 | $total_count = $query->countQuery()->execute()->fetchField(); |
68 | 68 | |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | |
82 | 82 | foreach (\Drupal\image\Entity\ImageStyle::loadMultiple() as $name => $style) { |
83 | 83 | if (!empty($excludes) && in_array($style->getName(), $excludes)) { |
84 | - $operations[] = array('drush_log', array('Excluding ' . $name, 'success')); |
|
84 | + $operations[] = array('drush_log', array('Excluding '.$name, 'success')); |
|
85 | 85 | continue; |
86 | 86 | } |
87 | 87 | |
88 | 88 | if (empty($includes[0]) || in_array($style->getName(), $includes)) { |
89 | - $operations[] = array('drush_log', array('Processing ' . $name, 'success')); |
|
89 | + $operations[] = array('drush_log', array('Processing '.$name, 'success')); |
|
90 | 90 | $count = 1; |
91 | 91 | $last_progress = 0; |
92 | 92 | foreach ($files as $file) { |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | if (($progress % 25 === 0 || $progress % 7 === 0) && $progress != $last_progress) { |
100 | 100 | // If we're in the command line, print the percentage, otherwise hide it |
101 | 101 | if (PHP_SAPI === 'cli') { |
102 | - $operations[] = array('drush_print', array('...' . $progress . '%', 0, NULL, ($progress == 100))); |
|
102 | + $operations[] = array('drush_print', array('...'.$progress.'%', 0, NULL, ($progress == 100))); |
|
103 | 103 | } |
104 | 104 | $last_progress = $progress; |
105 | 105 | } |
@@ -41,21 +41,21 @@ |
||
41 | 41 | |
42 | 42 | // Inline the logo image as a data URL. |
43 | 43 | $theme = \Drupal::config('system.theme')->get('default'); |
44 | - $logo = DRUPAL_ROOT . '/' . theme_get_setting('logo.url', $theme); |
|
44 | + $logo = DRUPAL_ROOT.'/'.theme_get_setting('logo.url', $theme); |
|
45 | 45 | $mime = \Drupal::service('file.mime_type.guesser')->guess($logo); |
46 | 46 | $allowed_mime = ['image/svg+xml', 'image/png', 'image/jpeg', 'image/gif']; |
47 | 47 | if (in_array($mime, $allowed_mime, TRUE)) { |
48 | 48 | $data = base64_encode(file_get_contents($logo)); |
49 | - $logo_url = 'data: ' . $mime . ';base64,' . $data; |
|
49 | + $logo_url = 'data: '.$mime.';base64,'.$data; |
|
50 | 50 | } |
51 | 51 | else { |
52 | 52 | $logo_url = FALSE; |
53 | 53 | } |
54 | 54 | |
55 | 55 | // Use the current theme's template is available. |
56 | - $template_file = drupal_get_path('theme', $theme) . '/inky_templates/compiled/styled_email.html.twig'; |
|
56 | + $template_file = drupal_get_path('theme', $theme).'/inky_templates/compiled/styled_email.html.twig'; |
|
57 | 57 | if (file_exists($template_file)) { |
58 | - $template = str_replace(["'{{","}}'"], ['{{','}}'], file_get_contents($template_file)); |
|
58 | + $template = str_replace(["'{{", "}}'"], ['{{', '}}'], file_get_contents($template_file)); |
|
59 | 59 | } |
60 | 60 | else { |
61 | 61 | $template = '{{ message }}'; |
@@ -104,7 +104,7 @@ |
||
104 | 104 | 'format' => $format, |
105 | 105 | ]; |
106 | 106 | // Set a unique key for this mail. |
107 | - $key = 'rules_action_mail_' . $this->getPluginId(); |
|
107 | + $key = 'rules_action_mail_'.$this->getPluginId(); |
|
108 | 108 | $message = $this->mailManager->mail('df_tools_message', $key, $to, LanguageInterface::LANGCODE_NOT_SPECIFIED, $params); |
109 | 109 | if ($message['result']) { |
110 | 110 | $this->logger->notice('Successfully sent styled email to %recipient', ['%recipient' => $to]); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | return; |
51 | 51 | } |
52 | 52 | |
53 | - $config = \Drupal::configFactory()->getEditable('color.theme.' . $theme); |
|
53 | + $config = \Drupal::configFactory()->getEditable('color.theme.'.$theme); |
|
54 | 54 | |
55 | 55 | // Resolve palette. |
56 | 56 | if ($scheme != '') { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | // Make sure enough memory is available. |
66 | 66 | if (isset($info['base_image'])) { |
67 | 67 | // Fetch source image dimensions. |
68 | - $source = drupal_get_path('theme', $theme) . '/' . $info['base_image']; |
|
68 | + $source = drupal_get_path('theme', $theme).'/'.$info['base_image']; |
|
69 | 69 | list($width, $height) = getimagesize($source); |
70 | 70 | |
71 | 71 | // We need at least a copy of the source and a target buffer of the same |
@@ -102,28 +102,28 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | // Prepare target locations for generated files. |
105 | - $id = $theme . '-' . substr(hash('sha256', serialize($palette) . microtime()), 0, 8); |
|
105 | + $id = $theme.'-'.substr(hash('sha256', serialize($palette).microtime()), 0, 8); |
|
106 | 106 | $paths['color'] = 'public://color'; |
107 | - $paths['target'] = $paths['color'] . '/' . $id; |
|
107 | + $paths['target'] = $paths['color'].'/'.$id; |
|
108 | 108 | foreach ($paths as $path) { |
109 | 109 | file_prepare_directory($path, FILE_CREATE_DIRECTORY); |
110 | 110 | } |
111 | - $paths['target'] = $paths['target'] . '/'; |
|
111 | + $paths['target'] = $paths['target'].'/'; |
|
112 | 112 | $paths['id'] = $id; |
113 | - $paths['source'] = drupal_get_path('theme', $theme) . '/'; |
|
113 | + $paths['source'] = drupal_get_path('theme', $theme).'/'; |
|
114 | 114 | $paths['files'] = $paths['map'] = array(); |
115 | 115 | |
116 | 116 | // Save palette and logo location. |
117 | 117 | $config |
118 | 118 | ->set('palette', $palette) |
119 | - ->set('logo', $paths['target'] . 'logo.svg') |
|
119 | + ->set('logo', $paths['target'].'logo.svg') |
|
120 | 120 | ->save(); |
121 | 121 | |
122 | 122 | // Copy over neutral images. |
123 | 123 | foreach ($info['copy'] as $file) { |
124 | 124 | $base = drupal_basename($file); |
125 | - $source = $paths['source'] . $file; |
|
126 | - $filepath = file_unmanaged_copy($source, $paths['target'] . $base); |
|
125 | + $source = $paths['source'].$file; |
|
126 | + $filepath = file_unmanaged_copy($source, $paths['target'].$base); |
|
127 | 127 | $paths['map'][$file] = $base; |
128 | 128 | $paths['files'][] = $filepath; |
129 | 129 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | foreach ($info['css'] as $stylesheet) { |
139 | 139 | // Build a temporary array with CSS files. |
140 | 140 | $files = array(); |
141 | - if (file_exists($paths['source'] . $stylesheet)) { |
|
141 | + if (file_exists($paths['source'].$stylesheet)) { |
|
142 | 142 | $files[] = $stylesheet; |
143 | 143 | } |
144 | 144 | |
@@ -147,11 +147,11 @@ discard block |
||
147 | 147 | // Aggregate @imports recursively for each configured top level CSS file |
148 | 148 | // without optimization. Aggregation and optimization will be |
149 | 149 | // handled by drupal_build_css_cache() only. |
150 | - $style = $css_optimizer->loadFile($paths['source'] . $file, FALSE); |
|
150 | + $style = $css_optimizer->loadFile($paths['source'].$file, FALSE); |
|
151 | 151 | |
152 | 152 | // Return the path to where this CSS file originated from, stripping |
153 | 153 | // off the name of the file at the end of the path. |
154 | - $css_optimizer->rewriteFileURIBasePath = base_path() . dirname($paths['source'] . $file) . '/'; |
|
154 | + $css_optimizer->rewriteFileURIBasePath = base_path().dirname($paths['source'].$file).'/'; |
|
155 | 155 | |
156 | 156 | // Prefix all paths within this CSS file, ignoring absolute paths. |
157 | 157 | $style = preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', array($css_optimizer, 'rewriteFileURI'), $style); |
@@ -159,8 +159,8 @@ discard block |
||
159 | 159 | // Rewrite stylesheet with new colors. |
160 | 160 | $style = _df_tools_color_color_rewrite_stylesheet($theme, $info, $paths, $palette, $style); |
161 | 161 | $base_file = drupal_basename($file); |
162 | - $css[] = $paths['target'] . $base_file; |
|
163 | - _color_save_stylesheet($paths['target'] . $base_file, $style, $paths); |
|
162 | + $css[] = $paths['target'].$base_file; |
|
163 | + _color_save_stylesheet($paths['target'].$base_file, $style, $paths); |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | // Convert placeholder ids to the format we handle. |
218 | 218 | foreach ($palette_template as $color_id => $color_placeholder) { |
219 | - $palette_template[$color_id] = '#__' . Html::cleanCssIdentifier((string) $color_placeholder, $filter) . '__'; |
|
219 | + $palette_template[$color_id] = '#__'.Html::cleanCssIdentifier((string) $color_placeholder, $filter).'__'; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | return $palette_template; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | // Replace paths to images. |
293 | 293 | foreach ($paths['map'] as $before => $after) { |
294 | - $before = base_path() . $paths['source'] . $before; |
|
294 | + $before = base_path().$paths['source'].$before; |
|
295 | 295 | $before = preg_replace('`(^|/)(?!../)([^/]+)/../`', '$1', $before); |
296 | 296 | $output = str_replace($before, $after, $output); |
297 | 297 | } |