@@ -96,8 +96,7 @@ discard block |
||
96 | 96 | $entity_view_mode_ids = array_keys(\Drupal::entityTypeManager()->getViewModes($entity->getEntityTypeId())); |
97 | 97 | if (in_array($view_mode_id, $entity_view_mode_ids)) { |
98 | 98 | $output = $entity->$field_name->view($view_mode_id); |
99 | - } |
|
100 | - else { |
|
99 | + } else { |
|
101 | 100 | // Each part of a custom (non-Entity Display) view mode ID is separated |
102 | 101 | // by a dash; the first part must be the module name. |
103 | 102 | $mode_id_parts = explode('-', $view_mode_id, 2); |
@@ -114,8 +113,7 @@ discard block |
||
114 | 113 | 'html' => $this->renderer->renderRoot($output), |
115 | 114 | ]; |
116 | 115 | return new JsonResponse($data); |
117 | - } |
|
118 | - else { |
|
116 | + } else { |
|
119 | 117 | return new JsonResponse(['main_error' => $this->t('File does not exist.')]); |
120 | 118 | } |
121 | 119 | } |
@@ -102,8 +102,7 @@ discard block |
||
102 | 102 | $this->ensureMyTable(); |
103 | 103 | if (is_array($this->value)) { |
104 | 104 | $location = $this->value[0]; |
105 | - } |
|
106 | - else { |
|
105 | + } else { |
|
107 | 106 | $location = $this->value; |
108 | 107 | } |
109 | 108 | |
@@ -151,8 +150,7 @@ discard block |
||
151 | 150 | foreach ($options as $key => $option) { |
152 | 151 | if (is_numeric($option)) { |
153 | 152 | $formula = str_replace(':' . $key, $option, $formula); |
154 | - } |
|
155 | - else { |
|
153 | + } else { |
|
156 | 154 | $formula = str_replace(':' . $key, $connection->escapeField($option), $formula); |
157 | 155 | } |
158 | 156 | } |
@@ -25,8 +25,7 @@ discard block |
||
25 | 25 | function df_tools_media_views_insert(ViewEntityInterface $view) { |
26 | 26 | if (\Drupal::isConfigSyncing()) { |
27 | 27 | return; |
28 | - } |
|
29 | - elseif (InstallerKernel::installationAttempted() && $view->id() == 'media') { |
|
28 | + } elseif (InstallerKernel::installationAttempted() && $view->id() == 'media') { |
|
30 | 29 | $display1 = &$view->getDisplay('entity_browser_1'); |
31 | 30 | $display2 = &$view->getDisplay('entity_browser_2'); |
32 | 31 | $display1['display_options']['filters']['field_tags_target_id'] = $display2['display_options']['filters']['field_tags_target_id'] = [ |
@@ -165,8 +164,7 @@ discard block |
||
165 | 164 | $entity->$image_field->focal_point = $x_y; |
166 | 165 | $entity->$image_field->alt = $entity->label(); |
167 | 166 | $entity->$image_field->target_id = $file->id(); |
168 | - } |
|
169 | - elseif (in_array($type, $types) |
|
167 | + } elseif (in_array($type, $types) |
|
170 | 168 | && $entity->hasField($image_field) |
171 | 169 | && !$entity->get($image_field)->isEmpty() |
172 | 170 | && $entity->hasField($unsplash_field) |