@@ -90,8 +90,7 @@ discard block |
||
90 | 90 | $entity_view_mode_ids = array_keys($this->entityManager()->getViewModes($entity->getEntityTypeId())); |
91 | 91 | if (in_array($view_mode_id, $entity_view_mode_ids)) { |
92 | 92 | $output = $entity->$field_name->view($view_mode_id); |
93 | - } |
|
94 | - else { |
|
93 | + } else { |
|
95 | 94 | // Each part of a custom (non-Entity Display) view mode ID is separated |
96 | 95 | // by a dash; the first part must be the module name. |
97 | 96 | $mode_id_parts = explode('-', $view_mode_id, 2); |
@@ -108,8 +107,7 @@ discard block |
||
108 | 107 | 'html' => $this->renderer->renderRoot($output), |
109 | 108 | ]; |
110 | 109 | return new JsonResponse($data); |
111 | - } |
|
112 | - else { |
|
110 | + } else { |
|
113 | 111 | return new JsonResponse(['main_error' => $this->t('File does not exist.')]); |
114 | 112 | } |
115 | 113 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | if ($migration != null) { |
49 | 49 | $definition = $migration->getPluginDefinition(); |
50 | 50 | $dump = Yaml::dump($definition); |
51 | - $file_url = $destination . $migration->id() . '.yml'; |
|
51 | + $file_url = $destination.$migration->id().'.yml'; |
|
52 | 52 | $message = t('Export migration @name?', ['@name' => $name]); |
53 | 53 | if (drush_confirm($message) && $data = file_save_data($dump, $file_url)) { |
54 | 54 | drush_print(t('File saved: @file', ['@file' => $data->getFileUri()])); |
@@ -75,8 +75,7 @@ |
||
75 | 75 | $dir = rtrim($dir, '/'); |
76 | 76 | if ($dir == 'public') { |
77 | 77 | $file_pattern = "[^\/]*"; // Finds anything that does not contain "/", should be fine. |
78 | - } |
|
79 | - else { |
|
78 | + } else { |
|
80 | 79 | $file_pattern = $dir ? $dir . ".+" : ".+"; |
81 | 80 | } |
82 | 81 |
@@ -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 | } |
@@ -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); |
@@ -34,12 +34,10 @@ |
||
34 | 34 | } |
35 | 35 | } |
36 | 36 | return $new_value; |
37 | - } |
|
38 | - else { |
|
37 | + } else { |
|
39 | 38 | throw new MigrateException('delimiter is empty'); |
40 | 39 | } |
41 | - } |
|
42 | - else { |
|
40 | + } else { |
|
43 | 41 | throw new MigrateException(sprintf('%s is not a string', var_export($value, TRUE))); |
44 | 42 | } |
45 | 43 | } |
@@ -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. |
@@ -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', |
@@ -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 }}'; |
@@ -47,8 +47,7 @@ discard block |
||
47 | 47 | if (in_array($mime, $allowed_mime, TRUE)) { |
48 | 48 | $data = base64_encode(file_get_contents($logo)); |
49 | 49 | $logo_url = 'data: ' . $mime . ';base64,' . $data; |
50 | - } |
|
51 | - else { |
|
50 | + } else { |
|
52 | 51 | $logo_url = FALSE; |
53 | 52 | } |
54 | 53 | |
@@ -56,8 +55,7 @@ discard block |
||
56 | 55 | $template_file = drupal_get_path('theme', $theme) . '/inky_templates/compiled/styled_email.html.twig'; |
57 | 56 | if (file_exists($template_file)) { |
58 | 57 | $template = str_replace(["'{{","}}'"], ['{{','}}'], file_get_contents($template_file)); |
59 | - } |
|
60 | - else { |
|
58 | + } else { |
|
61 | 59 | $template = '{{ message }}'; |
62 | 60 | } |
63 | 61 |