@@ -122,8 +122,7 @@ |
||
| 122 | 122 | $image->save(); |
| 123 | 123 | $file->filesize = $image->getFileSize(); |
| 124 | 124 | drupal_set_message(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', array('%dimensions' => $maximum_dimensions))); |
| 125 | - } |
|
| 126 | - else { |
|
| 125 | + } else { |
|
| 127 | 126 | $errors[] = t('The image exceeds the maximum allowed dimensions.'); |
| 128 | 127 | } |
| 129 | 128 | } |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | $delta = 0; |
| 229 | 229 | |
| 230 | - $order_class = $field_machine_name . '-delta-order'; |
|
| 230 | + $order_class = $field_machine_name.'-delta-order'; |
|
| 231 | 231 | |
| 232 | 232 | $current = [ |
| 233 | 233 | '#type' => 'table', |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | 'wrapper' => $details_id, |
| 362 | 362 | ], |
| 363 | 363 | '#submit' => [[get_class($this), 'removeItemSubmit']], |
| 364 | - '#name' => $field_machine_name . '_remove_' . $entity_id, |
|
| 364 | + '#name' => $field_machine_name.'_remove_'.$entity_id, |
|
| 365 | 365 | '#limit_validation_errors' => [], |
| 366 | 366 | '#attributes' => ['data-entity-id' => $entity_id], |
| 367 | 367 | '#access' => (bool) $widget_settings['field_widget_remove'], |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | // Return ourself as the structure doesn't match the default. |
| 419 | - usort($return, function ($a, $b) { |
|
| 419 | + usort($return, function($a, $b) { |
|
| 420 | 420 | return SortArray::sortByKeyInt($a, $b, '_weight'); |
| 421 | 421 | }); |
| 422 | 422 | |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | $data['validators']['file'] = ['validators' => $this->getFileValidators()]; |
| 477 | 477 | // Provide context for widgets to enhance their configuration. Currently |
| 478 | 478 | // we only know that "upload_location" is used. |
| 479 | - $data['widget_context']['upload_location'] = $settings['uri_scheme'] . '://' . $settings['file_directory']; |
|
| 479 | + $data['widget_context']['upload_location'] = $settings['uri_scheme'].'://'.$settings['file_directory']; |
|
| 480 | 480 | return $data; |
| 481 | 481 | } |
| 482 | 482 | |
@@ -177,8 +177,7 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | if (empty($entity_browser_id)) { |
| 179 | 179 | return [$this->t('No entity browser selected.')]; |
| 180 | - } |
|
| 181 | - else { |
|
| 180 | + } else { |
|
| 182 | 181 | $browser = $this->entityTypeManager->getStorage('entity_browser') |
| 183 | 182 | ->load($entity_browser_id); |
| 184 | 183 | $summary[] = $this->t('Entity browser: @browser', ['@browser' => $browser->label()]); |
@@ -194,8 +193,7 @@ discard block |
||
| 194 | 193 | // their styles in code. |
| 195 | 194 | if (isset($image_styles[$image_style_setting])) { |
| 196 | 195 | $preview_image_style = $this->t('Preview image style: @style', ['@style' => $image_styles[$image_style_setting]]); |
| 197 | - } |
|
| 198 | - else { |
|
| 196 | + } else { |
|
| 199 | 197 | $preview_image_style = $this->t('No preview image'); |
| 200 | 198 | } |
| 201 | 199 | } |
@@ -263,8 +261,7 @@ discard block |
||
| 263 | 261 | if ($image->isValid()) { |
| 264 | 262 | $width = $image->getWidth(); |
| 265 | 263 | $height = $image->getHeight(); |
| 266 | - } |
|
| 267 | - else { |
|
| 264 | + } else { |
|
| 268 | 265 | $width = $height = NULL; |
| 269 | 266 | } |
| 270 | 267 | |
@@ -276,8 +273,7 @@ discard block |
||
| 276 | 273 | '#style_name' => $widget_settings['preview_image_style'], |
| 277 | 274 | '#uri' => $uri, |
| 278 | 275 | ]; |
| 279 | - } |
|
| 280 | - else { |
|
| 276 | + } else { |
|
| 281 | 277 | $display = $this->entityTypeManager->getViewBuilder('file')->view($entity, $view_mode); |
| 282 | 278 | } |
| 283 | 279 | |
@@ -292,8 +288,7 @@ discard block |
||
| 292 | 288 | if ($field_type == 'file') { |
| 293 | 289 | $description = $item->description; |
| 294 | 290 | $display_field = $item->display; |
| 295 | - } |
|
| 296 | - elseif ($field_type == 'image') { |
|
| 291 | + } elseif ($field_type == 'image') { |
|
| 297 | 292 | $alt = $item->alt; |
| 298 | 293 | $title = $item->title; |
| 299 | 294 | } |
@@ -453,8 +448,7 @@ discard block |
||
| 453 | 448 | $extensions = isset($settings['file_extensions']) ? $settings['file_extensions'] : implode(' ', $supported_extensions); |
| 454 | 449 | $extensions = array_intersect(explode(' ', $extensions), $supported_extensions); |
| 455 | 450 | $validators['file_validate_extensions'] = [implode(' ', $extensions)]; |
| 456 | - } |
|
| 457 | - elseif (!empty($settings['file_extensions'])) { |
|
| 451 | + } elseif (!empty($settings['file_extensions'])) { |
|
| 458 | 452 | $validators['file_validate_extensions'] = [$settings['file_extensions']]; |
| 459 | 453 | } |
| 460 | 454 | |