@@ -55,8 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | drupal_set_message(t('Successfully exported Panelizer display for Node @nid to @panels_file', ['@nid' => $node->id(), '@panels_file' => $panels_file])); |
| 57 | 57 | return TRUE; |
| 58 | - } |
|
| 59 | - else { |
|
| 58 | + } else { |
|
| 60 | 59 | drupal_set_message(t('The given Node is not Panelized.'), 'error'); |
| 61 | 60 | return FALSE; |
| 62 | 61 | } |
@@ -41,8 +41,7 @@ discard block |
||
| 41 | 41 | if (empty($destination)) { |
| 42 | 42 | return drush_user_abort(); |
| 43 | 43 | } |
| 44 | - } |
|
| 45 | - elseif (!isset($destination)) { |
|
| 44 | + } elseif (!isset($destination)) { |
|
| 46 | 45 | $destination = CONFIG_SYNC_DIRECTORY; |
| 47 | 46 | } |
| 48 | 47 | $destination_dir = config_get_config_directory($destination); |
@@ -84,13 +83,11 @@ discard block |
||
| 84 | 83 | $destination = $destination_dir . basename($source); |
| 85 | 84 | if (!copy($source, $destination)) { |
| 86 | 85 | drush_log(dt('New copy from @source to @destination failed.', ['@source' => $source, '@destination' => $destination]), LogLevel::ERROR); |
| 87 | - } |
|
| 88 | - else { |
|
| 86 | + } else { |
|
| 89 | 87 | _df_tools_config_strip_uuid($destination); |
| 90 | 88 | drush_log(dt('Successfully created @config.', ['@config' => $config]), LogLevel::OK); |
| 91 | 89 | } |
| 92 | - } |
|
| 93 | - catch (InvalidArgumentException $e) { |
|
| 90 | + } catch (InvalidArgumentException $e) { |
|
| 94 | 91 | drush_log(dt('Module @input does not exist or is not enabled.', ['@input' => $input]), LogLevel::ERROR); |
| 95 | 92 | } |
| 96 | 93 | } |
@@ -105,8 +102,7 @@ discard block |
||
| 105 | 102 | $destination = $instances[$choice]; |
| 106 | 103 | if (!copy($source, $destination)) { |
| 107 | 104 | drush_log(dt('Copy from @source to @destination failed.', ['@source' => $source, '@destination' => $destination]), LogLevel::ERROR); |
| 108 | - } |
|
| 109 | - else { |
|
| 105 | + } else { |
|
| 110 | 106 | _df_tools_config_strip_uuid($destination); |
| 111 | 107 | drush_log(dt('Successfully copied @config.', ['@config' => $config]), LogLevel::OK); |
| 112 | 108 | } |
@@ -120,8 +116,7 @@ discard block |
||
| 120 | 116 | if ($choice !== FALSE) { |
| 121 | 117 | if (!unlink($instances[$choice])) { |
| 122 | 118 | drush_log(dt('Deletion of @path failed.', ['@path' => $instances[$choice]]), LogLevel::ERROR); |
| 123 | - } |
|
| 124 | - else { |
|
| 119 | + } else { |
|
| 125 | 120 | drush_log(dt('Successfully deleted @config.', ['@config' => $config]), LogLevel::OK); |
| 126 | 121 | } |
| 127 | 122 | } |
@@ -221,8 +216,7 @@ discard block |
||
| 221 | 216 | file_put_contents($filepath, implode($file)); |
| 222 | 217 | } |
| 223 | 218 | return TRUE; |
| 224 | - } |
|
| 225 | - else { |
|
| 219 | + } else { |
|
| 226 | 220 | return FALSE; |
| 227 | 221 | } |
| 228 | 222 | } |
@@ -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 | |
@@ -150,8 +149,7 @@ discard block |
||
| 150 | 149 | foreach ($options as $key => $option) { |
| 151 | 150 | if (is_numeric($option)) { |
| 152 | 151 | $formula = str_replace(':' . $key, $option, $formula); |
| 153 | - } |
|
| 154 | - else { |
|
| 152 | + } else { |
|
| 155 | 153 | $formula = str_replace(':' . $key, db_escape_field($option), $formula); |
| 156 | 154 | } |
| 157 | 155 | } |
@@ -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 | } |
@@ -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 | |
@@ -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 | } |
@@ -40,8 +40,7 @@ |
||
| 40 | 40 | $widget_form['#title'] = ''; |
| 41 | 41 | $widget_form['entity_id']['#title'] = t('Existing slide'); |
| 42 | 42 | $widget_form['actions']['ief_reference_save']['#value'] = t('Add'); |
| 43 | - } |
|
| 44 | - else { |
|
| 43 | + } else { |
|
| 45 | 44 | $widget_form['inline_entity_form']['#ief_labels']['singular'] = 'slide'; |
| 46 | 45 | } |
| 47 | 46 | } |
@@ -25,8 +25,7 @@ |
||
| 25 | 25 | list($lat, $lon) = explode(',', $geolocation); |
| 26 | 26 | $point = [$lon, $lat]; |
| 27 | 27 | $row->setSourceProperty('Geofield', \Drupal::service('geofield.wkt_generator')->WktBuildPoint($point)); |
| 28 | - } |
|
| 29 | - else { |
|
| 28 | + } else { |
|
| 30 | 29 | // Manually geocode from source information. |
| 31 | 30 | $address = $row->getSourceProperty('Address Line 1'); |
| 32 | 31 | $address2 = $row->getSourceProperty('Address Line 2'); |
@@ -39,8 +39,7 @@ discard block |
||
| 39 | 39 | // Prefer UUIDs to other fields. |
| 40 | 40 | if (in_array('UUID', $ids, TRUE)) { |
| 41 | 41 | $id_map = ['uuid', 'UUID']; |
| 42 | - } |
|
| 43 | - else { |
|
| 42 | + } else { |
|
| 44 | 43 | foreach ($processes as $field => $process) { |
| 45 | 44 | if (isset($process[0]['source']) && $process[0]['source'] == $ids[0]) { |
| 46 | 45 | $id_map = [$field, $ids[0]]; |
@@ -98,8 +97,7 @@ discard block |
||
| 98 | 97 | $entity_values = $entity->toArray(); |
| 99 | 98 | $entity_values['path'] = []; |
| 100 | 99 | $translation = $entity->addTranslation($langcode, $entity_values); |
| 101 | - } |
|
| 102 | - else { |
|
| 100 | + } else { |
|
| 103 | 101 | $translation = $entity->getTranslation($langcode); |
| 104 | 102 | } |
| 105 | 103 | |