| @@ -10,13 +10,13 @@ | ||
| 10 | 10 |    foreach ($geofield_map as $entity_type_id => $fields) { | 
| 11 | 11 |      foreach ($fields as $field_name => $info) { | 
| 12 | 12 |        $args = array('@field_name' => $field_name); | 
| 13 | - $data_key = $entity_type_id . '__' . $field_name; | |
| 13 | + $data_key = $entity_type_id.'__'.$field_name; | |
| 14 | 14 | |
| 15 | 15 | $field_coordinates_table_data = $data[$data_key][$field_name]; | 
| 16 | - $data[$data_key][$data_key . '_simple_proximity'] = [ | |
| 16 | + $data[$data_key][$data_key.'_simple_proximity'] = [ | |
| 17 | 17 | 'group' => 'Content', | 
| 18 | 18 |          'title' => t('Simple Proximity (@field_name)', $args), | 
| 19 | -        'title short' => $field_coordinates_table_data['title short'] . t(' Simple Proximity'), | |
| 19 | +        'title short' => $field_coordinates_table_data['title short'].t(' Simple Proximity'), | |
| 20 | 20 | 'help' => $field_coordinates_table_data['help'], | 
| 21 | 21 | 'real field' => $field_name, | 
| 22 | 22 | 'filter' => [ | 
| @@ -43,12 +43,12 @@ discard block | ||
| 43 | 43 | } | 
| 44 | 44 |          else { | 
| 45 | 45 |            foreach ($value as $j) { | 
| 46 | - $output[] = $this->keysToString($keys) . '[] = ' . $j; | |
| 46 | + $output[] = $this->keysToString($keys).'[] = '.$j; | |
| 47 | 47 | } | 
| 48 | 48 | } | 
| 49 | 49 | } | 
| 50 | 50 |        else { | 
| 51 | - $output[] = $this->keysToString($keys) . ' = ' . $value; | |
| 51 | + $output[] = $this->keysToString($keys).' = '.$value; | |
| 52 | 52 | } | 
| 53 | 53 | |
| 54 | 54 | array_pop($keys); | 
| @@ -69,7 +69,7 @@ discard block | ||
| 69 | 69 |    protected function keysToString(array $keys) { | 
| 70 | 70 | $head = array_shift($keys); | 
| 71 | 71 |      if ($keys) { | 
| 72 | -      return $head . '[' . implode('][', $keys) . ']'; | |
| 72 | +      return $head.'['.implode('][', $keys).']'; | |
| 73 | 73 | } | 
| 74 | 74 |      else { | 
| 75 | 75 | return $head; | 
| @@ -123,7 +123,7 @@ discard block | ||
| 123 | 123 |          foreach (['key', 'value1', 'value2', 'value3'] as $var) { | 
| 124 | 124 | $$var = isset($match[++$i]) ? $match[$i] : ''; | 
| 125 | 125 | } | 
| 126 | - $value = stripslashes(substr($value1, 1, -1)) . stripslashes(substr($value2, 1, -1)) . $value3; | |
| 126 | + $value = stripslashes(substr($value1, 1, -1)).stripslashes(substr($value2, 1, -1)).$value3; | |
| 127 | 127 | |
| 128 | 128 | // Parse array syntax. | 
| 129 | 129 |          $keys = preg_split('/\]?\[/', rtrim($key, ']')); | 
| @@ -40,14 +40,12 @@ discard block | ||
| 40 | 40 |        if (is_array($value)) { | 
| 41 | 41 |          if ($this->isAssociative($value)) { | 
| 42 | 42 | $output = array_merge($output, $this->doEncode($value, $keys)); | 
| 43 | - } | |
| 44 | -        else { | |
| 43 | +        } else { | |
| 45 | 44 |            foreach ($value as $j) { | 
| 46 | 45 | $output[] = $this->keysToString($keys) . '[] = ' . $j; | 
| 47 | 46 | } | 
| 48 | 47 | } | 
| 49 | - } | |
| 50 | -      else { | |
| 48 | +      } else { | |
| 51 | 49 | $output[] = $this->keysToString($keys) . ' = ' . $value; | 
| 52 | 50 | } | 
| 53 | 51 | |
| @@ -70,8 +68,7 @@ discard block | ||
| 70 | 68 | $head = array_shift($keys); | 
| 71 | 69 |      if ($keys) { | 
| 72 | 70 |        return $head . '[' . implode('][', $keys) . ']'; | 
| 73 | - } | |
| 74 | -    else { | |
| 71 | +    } else { | |
| 75 | 72 | return $head; | 
| 76 | 73 | } | 
| 77 | 74 | } | 
| @@ -53,8 +53,7 @@ | ||
| 53 | 53 |      foreach ($arguments as $argument) { | 
| 54 | 54 |        if ($argument{0} == '-') { | 
| 55 | 55 | $task->rawArg($argument); | 
| 56 | - } | |
| 57 | -      else { | |
| 56 | +      } else { | |
| 58 | 57 | $feature = "tests/features/$argument"; | 
| 59 | 58 | |
| 60 | 59 |          if (file_exists("$feature.feature")) { | 
| @@ -39,7 +39,7 @@ | ||
| 39 | 39 | * @return \Robo\Contract\TaskInterface | 
| 40 | 40 | * The task to execute. | 
| 41 | 41 | */ | 
| 42 | -  public function configureBehat ($base_url = NULL) { | |
| 42 | +  public function configureBehat($base_url = NULL) { | |
| 43 | 43 | $configuration = []; | 
| 44 | 44 | |
| 45 | 45 | /** @var Finder $partials */ | 
| @@ -181,11 +181,11 @@ | ||
| 181 | 181 | // Check if this field is an Address field. | 
| 182 | 182 |        if (isset($address['address_line1'])) { | 
| 183 | 183 | // Format the address as a single string. | 
| 184 | - $string .= $address['address_line1'] . "\n"; | |
| 185 | - $string .= !empty($address['address_line2']) ? $address['address_line2'] . "\n" : ''; | |
| 186 | - $string .= $address['locality'] . ', '; | |
| 187 | -        $string .= str_replace('US-', '', $address['administrative_area']) . ' '; | |
| 188 | - $string .= $address['postal_code'] . "\n"; | |
| 184 | + $string .= $address['address_line1']."\n"; | |
| 185 | + $string .= !empty($address['address_line2']) ? $address['address_line2']."\n" : ''; | |
| 186 | + $string .= $address['locality'].', '; | |
| 187 | +        $string .= str_replace('US-', '', $address['administrative_area']).' '; | |
| 188 | + $string .= $address['postal_code']."\n"; | |
| 189 | 189 | $string .= $address['country_code']; | 
| 190 | 190 | } | 
| 191 | 191 | |
| @@ -126,8 +126,7 @@ | ||
| 126 | 126 |      $coordinates = $this->getSetting('show_coordinates'); | 
| 127 | 127 |      if ($coordinates) { | 
| 128 | 128 |        $summary[] = $this->t('Coordinates are shown'); | 
| 129 | - } | |
| 130 | -    else { | |
| 129 | +    } else { | |
| 131 | 130 |        $summary[] = $this->t('Coordinates are hidden'); | 
| 132 | 131 | } | 
| 133 | 132 | |
| @@ -112,8 +112,7 @@ discard block | ||
| 112 | 112 | $name = 'drupal'; | 
| 113 | 113 | } | 
| 114 | 114 | $info['projects'][$name] = $this->buildProject($package); | 
| 115 | - } | |
| 116 | -      elseif ($this->isLightning($package)) { | |
| 115 | +      } elseif ($this->isLightning($package)) { | |
| 117 | 116 | $info['projects'][$name] = $this->buildProject($package); | 
| 118 | 117 | |
| 119 | 118 | // The Lightning project uses semantic versioning. | 
| @@ -283,8 +282,7 @@ discard block | ||
| 283 | 282 | 'type' => 'get', | 
| 284 | 283 | 'url' => $package['dist']['url'], | 
| 285 | 284 | ]; | 
| 286 | - } | |
| 287 | -    else { | |
| 285 | +    } else { | |
| 288 | 286 | $download = [ | 
| 289 | 287 | 'type' => 'git', | 
| 290 | 288 |          'url' => str_replace('[email protected]:', 'https://github.com/', $package['source']['url']), | 
| @@ -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 | } | 
| @@ -56,9 +56,9 @@ discard block | ||
| 56 | 56 | // Don't show this element in the context of an admin menu. | 
| 57 | 57 |      if (!isset($form['admin_label'])) { | 
| 58 | 58 | $form['value']['#suffix'] = | 
| 59 | -        '<a class="simple-proximity-location-button button" title="' . $this->t('Use your current location') . '">' . | |
| 60 | - ' <i class="fa fa-map-marker" aria-hidden="true"></i>' . | |
| 61 | - '</a>' . $form['value']['#suffix']; | |
| 59 | +        '<a class="simple-proximity-location-button button" title="'.$this->t('Use your current location').'">'. | |
| 60 | + ' <i class="fa fa-map-marker" aria-hidden="true"></i>'. | |
| 61 | + '</a>'.$form['value']['#suffix']; | |
| 62 | 62 | $form['value']['#attached'] = ['library' => ['df_tools_map/main']]; | 
| 63 | 63 | } | 
| 64 | 64 | } | 
| @@ -110,15 +110,15 @@ discard block | ||
| 110 | 110 | // Geocode the location if it's present. | 
| 111 | 111 |      if (!empty($location)) { | 
| 112 | 112 |        $provider = \Drupal::entityTypeManager()->getStorage('geocoder_provider')->load('googlemaps'); | 
| 113 | -      if ($collection = \Drupal::service('geocoder')->geocode($location,[$provider])) { | |
| 113 | +      if ($collection = \Drupal::service('geocoder')->geocode($location, [$provider])) { | |
| 114 | 114 | $coordinates = $collection->first()->getCoordinates(); | 
| 115 | 115 | |
| 116 | 116 | // Generate a distance formula programatically. | 
| 117 | 117 | $haversine_options = [ | 
| 118 | 118 | 'origin_latitude' => $coordinates->getLatitude(), | 
| 119 | 119 | 'origin_longitude' => $coordinates->getLongitude(), | 
| 120 | - 'destination_latitude' => $this->table . '.' . $this->realField . '_lat', | |
| 121 | - 'destination_longitude' => $this->table . '.' . $this->realField . '_lon', | |
| 120 | + 'destination_latitude' => $this->table.'.'.$this->realField.'_lat', | |
| 121 | + 'destination_longitude' => $this->table.'.'.$this->realField.'_lon', | |
| 122 | 122 | 'earth_radius' => GEOFIELD_KILOMETERS, | 
| 123 | 123 | ]; | 
| 124 | 124 | |
| @@ -126,13 +126,13 @@ discard block | ||
| 126 | 126 | |
| 127 | 127 | /** @var \Drupal\views\Plugin\views\query\Sql $query */ | 
| 128 | 128 | $query = $this->query; | 
| 129 | - $query->addOrderBy(NULL, $formula, 'ASC', $this->table . '_simple_proximity'); | |
| 129 | + $query->addOrderBy(NULL, $formula, 'ASC', $this->table.'_simple_proximity'); | |
| 130 | 130 | |
| 131 | 131 | // Add a where expression if a distance is used. | 
| 132 | 132 |          if ($this->options['expose']['distance']) { | 
| 133 | 133 | $distance = $this->options['expose']['distance']; | 
| 134 | - $placeholder = $query->placeholder($this->table . '_simple_proximity'); | |
| 135 | -          $query->addWhereExpression(0, '(' . $formula . ' <= ' . $placeholder . ')', [$placeholder => $distance]); | |
| 134 | + $placeholder = $query->placeholder($this->table.'_simple_proximity'); | |
| 135 | +          $query->addWhereExpression(0, '('.$formula.' <= '.$placeholder.')', [$placeholder => $distance]); | |
| 136 | 136 | } | 
| 137 | 137 | } | 
| 138 | 138 | } | 
| @@ -151,10 +151,10 @@ discard block | ||
| 151 | 151 | |
| 152 | 152 |      foreach ($options as $key => $option) { | 
| 153 | 153 |        if (is_numeric($option)) { | 
| 154 | -        $formula = str_replace(':' . $key, $option, $formula); | |
| 154 | +        $formula = str_replace(':'.$key, $option, $formula); | |
| 155 | 155 | } | 
| 156 | 156 |        else { | 
| 157 | -        $formula = str_replace(':' . $key, $connection->escapeField($option), $formula); | |
| 157 | +        $formula = str_replace(':'.$key, $connection->escapeField($option), $formula); | |
| 158 | 158 | } | 
| 159 | 159 | } | 
| 160 | 160 | |
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | -include_once \Drupal::service('extension.list.module')->getPath('locale') . '/locale.bulk.inc'; | |
| 4 | -include_once \Drupal::service('extension.list.module')->getPath('locale') . '/locale.batch.inc'; | |
| 3 | +include_once \Drupal::service('extension.list.module')->getPath('locale').'/locale.bulk.inc'; | |
| 4 | +include_once \Drupal::service('extension.list.module')->getPath('locale').'/locale.batch.inc'; | |
| @@ -67,7 +67,7 @@ discard block | ||
| 67 | 67 | |
| 68 | 68 | // Import each file. | 
| 69 | 69 |    foreach ($langcodes as $langcode) { | 
| 70 | - $filepath = DRUPAL_ROOT . '/' . $path . '/translations/' . $langcode . '.po'; | |
| 70 | + $filepath = DRUPAL_ROOT.'/'.$path.'/translations/'.$langcode.'.po'; | |
| 71 | 71 |      if (file_exists($filepath)) { | 
| 72 | 72 |        \Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc'); | 
| 73 | 73 |        \Drupal::moduleHandler()->loadInclude('locale', 'translation.inc'); | 
| @@ -81,7 +81,7 @@ discard block | ||
| 81 | 81 | ]); | 
| 82 | 82 | |
| 83 | 83 | $original_file = (object) [ | 
| 84 | - 'filename' => $langcode . '.po', | |
| 84 | + 'filename' => $langcode.'.po', | |
| 85 | 85 | 'uri' => $filepath | 
| 86 | 86 | ]; | 
| 87 | 87 | $file = locale_translate_file_attach_properties($original_file, $options); | 
| @@ -100,7 +100,7 @@ discard block | ||
| 100 | 100 |      $path = \Drupal::service('path.current')->getPath(); | 
| 101 | 101 | $language = $variables['language']->getId(); | 
| 102 | 102 |      $alias = \Drupal::service('path_alias.manager')->getAliasByPath($path, $language); | 
| 103 | -    $url = Url::fromUri('internal:/' . $alias); | |
| 103 | +    $url = Url::fromUri('internal:/'.$alias); | |
| 104 | 104 | $name = t($variables['language']->getName()); | 
| 105 | 105 | $link = Link::fromTextAndUrl($name, $url)->toString(); | 
| 106 | 106 | $variables['language_current_link'] = $link; | 
| @@ -128,7 +128,7 @@ discard block | ||
| 128 | 128 |        if ($langcode == 'en') { | 
| 129 | 129 | $langcode = ''; | 
| 130 | 130 | } | 
| 131 | -      $url = Url::fromUri('base:/' . $langcode . $alias); | |
| 131 | +      $url = Url::fromUri('base:/'.$langcode.$alias); | |
| 132 | 132 | $current_name = t($language->getName()); | 
| 133 | 133 | $links[] = Link::fromTextAndUrl($current_name, $url)->toString(); | 
| 134 | 134 | } | 
| @@ -62,7 +62,7 @@ discard block | ||
| 62 | 62 | global $base_url; | 
| 63 | 63 | |
| 64 | 64 |      header('Content-Type: application/json'); | 
| 65 | - $json_output = (string) $this->httpClient->get($base_url . '/api/node/article')->getBody(); | |
| 65 | + $json_output = (string) $this->httpClient->get($base_url.'/api/node/article')->getBody(); | |
| 66 | 66 | $json_pretty = json_encode(json_decode($json_output), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); | 
| 67 | 67 |      $json_indented_by_2 = preg_replace('/^(  +?)\\1(?=[^ ])/m', '$1', $json_pretty); | 
| 68 | 68 | |
| @@ -71,10 +71,10 @@ discard block | ||
| 71 | 71 | <button class="btn btn-primary button button--primary coh-style-link-button | 
| 72 | 72 | coh-style-link-button-color open-apiModal">Expand API Response</button> | 
| 73 | 73 | <div class="apiResponse"> | 
| 74 | - <pre><code class="language-json">' . $json_indented_by_2 . '</code></pre> | |
| 74 | + <pre><code class="language-json">' . $json_indented_by_2.'</code></pre> | |
| 75 | 75 | </div> | 
| 76 | 76 | <div class="apiResponseModal"> | 
| 77 | - <pre><code class="language-json">' . $json_indented_by_2 . '</code></pre> | |
| 77 | + <pre><code class="language-json">' . $json_indented_by_2.'</code></pre> | |
| 78 | 78 | </div> | 
| 79 | 79 | </div>', | 
| 80 | 80 | '#attached' => ['library' => ['df_tools_article/main']], |