Commit 6098437e authored by alexpott's avatar alexpott

Issue #2572793 by attiks, andypost: Fix 'Drupal.WhiteSpace.OperatorSpacing' coding standard

parent 5c386edc
...@@ -623,7 +623,7 @@ function drupal_valid_test_ua($new_prefix = NULL) { ...@@ -623,7 +623,7 @@ function drupal_valid_test_ua($new_prefix = NULL) {
$user_agent = isset($_COOKIE['SIMPLETEST_USER_AGENT']) ? $_COOKIE['SIMPLETEST_USER_AGENT'] : $http_user_agent; $user_agent = isset($_COOKIE['SIMPLETEST_USER_AGENT']) ? $_COOKIE['SIMPLETEST_USER_AGENT'] : $http_user_agent;
if (isset($user_agent) && preg_match("/^(simpletest\d+):(.+):(.+):(.+)$/", $user_agent, $matches)) { if (isset($user_agent) && preg_match("/^(simpletest\d+):(.+):(.+):(.+)$/", $user_agent, $matches)) {
list(, $prefix, $time, $salt, $hmac) = $matches; list(, $prefix, $time, $salt, $hmac) = $matches;
$check_string = $prefix . ':' . $time . ':' . $salt; $check_string = $prefix . ':' . $time . ':' . $salt;
// Read the hash salt prepared by drupal_generate_test_ua(). // Read the hash salt prepared by drupal_generate_test_ua().
// This function is called before settings.php is read and Drupal's error // This function is called before settings.php is read and Drupal's error
// handlers are set up. While Drupal's error handling may be properly // handlers are set up. While Drupal's error handling may be properly
......
...@@ -1797,7 +1797,7 @@ function install_check_translations($langcode, $server_pattern) { ...@@ -1797,7 +1797,7 @@ function install_check_translations($langcode, $server_pattern) {
$writable = FALSE; $writable = FALSE;
// @todo: Make this configurable. // @todo: Make this configurable.
$site_path = \Drupal::service('site.path'); $site_path = \Drupal::service('site.path');
$files_directory = $site_path . '/files'; $files_directory = $site_path . '/files';
$translations_directory = $site_path . '/files/translations'; $translations_directory = $site_path . '/files/translations';
$translations_directory_exists = FALSE; $translations_directory_exists = FALSE;
$online = FALSE; $online = FALSE;
......
...@@ -515,7 +515,7 @@ function drupal_install_config_directories() { ...@@ -515,7 +515,7 @@ function drupal_install_config_directories() {
// they can later be added to git. Since this directory is auto-created, we // they can later be added to git. Since this directory is auto-created, we
// have to write out the README rather than just adding it to the drupal core // have to write out the README rather than just adding it to the drupal core
// repo. // repo.
$text = 'This directory contains configuration to be imported into your Drupal site. To make this configuration active, visit admin/config/development/configuration/sync.' .' For information about deploying configuration between servers, see https://www.drupal.org/documentation/administer/config'; $text = 'This directory contains configuration to be imported into your Drupal site. To make this configuration active, visit admin/config/development/configuration/sync.' .' For information about deploying configuration between servers, see https://www.drupal.org/documentation/administer/config';
file_put_contents(config_get_config_directory(CONFIG_SYNC_DIRECTORY) . '/README.txt', $text); file_put_contents(config_get_config_directory(CONFIG_SYNC_DIRECTORY) . '/README.txt', $text);
} }
......
...@@ -1265,7 +1265,7 @@ function template_preprocess_html(&$variables) { ...@@ -1265,7 +1265,7 @@ function template_preprocess_html(&$variables) {
// Add a variable for the root path. This can be used to create a class and // Add a variable for the root path. This can be used to create a class and
// theme the page depending on the current path (e.g. node, admin, user) as // theme the page depending on the current path (e.g. node, admin, user) as
// well as more specific data like path-frontpage. // well as more specific data like path-frontpage.
$is_front_page = \Drupal::service('path.matcher')->isFrontPage(); $is_front_page = \Drupal::service('path.matcher')->isFrontPage();
if ($is_front_page) { if ($is_front_page) {
$variables['root_path'] = FALSE; $variables['root_path'] = FALSE;
......
...@@ -181,7 +181,7 @@ protected function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) { ...@@ -181,7 +181,7 @@ protected function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) {
} }
} }
$this->lcs = 0; $this->lcs = 0;
$this->seq[0]= $yoff - 1; $this->seq[0] = $yoff - 1;
$this->in_seq = array(); $this->in_seq = array();
$ymids[0] = array(); $ymids[0] = array();
...@@ -190,11 +190,11 @@ protected function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) { ...@@ -190,11 +190,11 @@ protected function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) {
for ($chunk = 0; $chunk < $nchunks; $chunk++) { for ($chunk = 0; $chunk < $nchunks; $chunk++) {
if ($chunk > 0) { if ($chunk > 0) {
for ($i = 0; $i <= $this->lcs; $i++) { for ($i = 0; $i <= $this->lcs; $i++) {
$ymids[$i][$chunk-1] = $this->seq[$i]; $ymids[$i][$chunk - 1] = $this->seq[$i];
} }
} }
$x1 = $xoff + (int)(($numer + ($xlim-$xoff)*$chunk) / $nchunks); $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $chunk) / $nchunks);
for ( ; $x < $x1; $x++) { for ( ; $x < $x1; $x++) {
$line = $flip ? $this->yv[$x] : $this->xv[$x]; $line = $flip ? $this->yv[$x] : $this->xv[$x];
if (empty($ymatches[$line])) { if (empty($ymatches[$line])) {
...@@ -206,12 +206,12 @@ protected function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) { ...@@ -206,12 +206,12 @@ protected function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) {
if (empty($this->in_seq[$y])) { if (empty($this->in_seq[$y])) {
$k = $this->_lcs_pos($y); $k = $this->_lcs_pos($y);
$this::USE_ASSERTS && assert($k > 0); $this::USE_ASSERTS && assert($k > 0);
$ymids[$k] = $ymids[$k-1]; $ymids[$k] = $ymids[$k - 1];
break; break;
} }
} }
while (list ($junk, $y) = each($matches)) { while (list ($junk, $y) = each($matches)) {
if ($y > $this->seq[$k-1]) { if ($y > $this->seq[$k - 1]) {
$this::USE_ASSERTS && assert($y < $this->seq[$k]); $this::USE_ASSERTS && assert($y < $this->seq[$k]);
// Optimization: this is a common case: // Optimization: this is a common case:
// next match is just replacing previous match. // next match is just replacing previous match.
...@@ -222,7 +222,7 @@ protected function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) { ...@@ -222,7 +222,7 @@ protected function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) {
elseif (empty($this->in_seq[$y])) { elseif (empty($this->in_seq[$y])) {
$k = $this->_lcs_pos($y); $k = $this->_lcs_pos($y);
$this::USE_ASSERTS && assert($k > 0); $this::USE_ASSERTS && assert($k > 0);
$ymids[$k] = $ymids[$k-1]; $ymids[$k] = $ymids[$k - 1];
} }
} }
} }
......
...@@ -50,7 +50,7 @@ public function save($name, $code) { ...@@ -50,7 +50,7 @@ public function save($name, $code) {
$path = $this->getFullPath($name); $path = $this->getFullPath($name);
$directory = dirname($path); $directory = dirname($path);
if ($this->ensureDirectory($directory)) { if ($this->ensureDirectory($directory)) {
$htaccess_path = $directory . '/.htaccess'; $htaccess_path = $directory . '/.htaccess';
if (!file_exists($htaccess_path) && file_put_contents($htaccess_path, static::htaccessLines())) { if (!file_exists($htaccess_path) && file_put_contents($htaccess_path, static::htaccessLines())) {
@chmod($htaccess_path, 0444); @chmod($htaccess_path, 0444);
} }
...@@ -126,7 +126,7 @@ public static function htaccessLines($private = TRUE) { ...@@ -126,7 +126,7 @@ public static function htaccessLines($private = TRUE) {
*/ */
protected function ensureDirectory($directory, $mode = 0777) { protected function ensureDirectory($directory, $mode = 0777) {
if ($this->createDirectory($directory, $mode)) { if ($this->createDirectory($directory, $mode)) {
$htaccess_path = $directory . '/.htaccess'; $htaccess_path = $directory . '/.htaccess';
if (!file_exists($htaccess_path) && file_put_contents($htaccess_path, static::htaccessLines())) { if (!file_exists($htaccess_path) && file_put_contents($htaccess_path, static::htaccessLines())) {
@chmod($htaccess_path, 0444); @chmod($htaccess_path, 0444);
} }
......
...@@ -139,7 +139,7 @@ public function name($length = 8, $unique = FALSE) { ...@@ -139,7 +139,7 @@ public function name($length = 8, $unique = FALSE) {
* @return string * @return string
*/ */
public function word($length) { public function word($length) {
mt_srand((double) microtime()*1000000); mt_srand((double) microtime() * 1000000);
$vowels = array("a", "e", "i", "o", "u"); $vowels = array("a", "e", "i", "o", "u");
$cons = array("b", "c", "d", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "u", "v", "w", "tr", $cons = array("b", "c", "d", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "u", "v", "w", "tr",
......
...@@ -83,7 +83,7 @@ public static function allowedIf($condition) { ...@@ -83,7 +83,7 @@ public static function allowedIf($condition) {
* will be TRUE. * will be TRUE.
*/ */
public static function forbiddenIf($condition) { public static function forbiddenIf($condition) {
return $condition ? static::forbidden(): static::neutral(); return $condition ? static::forbidden() : static::neutral();
} }
/** /**
......
...@@ -70,7 +70,7 @@ public function extract($path, array $files = array()) { ...@@ -70,7 +70,7 @@ public function extract($path, array $files = array()) {
*/ */
public function listContents() { public function listContents() {
$files = array(); $files = array();
for ($i=0; $i < $this->zip->numFiles; $i++) { for ($i = 0; $i < $this->zip->numFiles; $i++) {
$files[] = $this->zip->getNameIndex($i); $files[] = $this->zip->getNameIndex($i);
} }
return $files; return $files;
......
...@@ -68,7 +68,7 @@ public function render(array $js_assets) { ...@@ -68,7 +68,7 @@ public function render(array $js_assets) {
'type' => 'application/json', 'type' => 'application/json',
'data-drupal-selector' => 'drupal-settings-json', 'data-drupal-selector' => 'drupal-settings-json',
); );
$element['#value'] = Json::encode($js_asset['data']); $element['#value'] = Json::encode($js_asset['data']);
break; break;
case 'file': case 'file':
......
...@@ -272,7 +272,7 @@ public function getCacheKeys() { ...@@ -272,7 +272,7 @@ public function getCacheKeys() {
// $this->configFactoryOverrides, add cache keys for each. // $this->configFactoryOverrides, add cache keys for each.
$keys[] = 'global_overrides'; $keys[] = 'global_overrides';
foreach($this->configFactoryOverrides as $override) { foreach($this->configFactoryOverrides as $override) {
$keys[] = $override->getCacheSuffix(); $keys[] = $override->getCacheSuffix();
} }
return $keys; return $keys;
} }
......
...@@ -165,7 +165,7 @@ public function getDependentEntities($type, $name) { ...@@ -165,7 +165,7 @@ public function getDependentEntities($type, $name) {
// If checking content, module, or theme dependencies, discover which // If checking content, module, or theme dependencies, discover which
// entities are dependent on the entities that have a direct dependency. // entities are dependent on the entities that have a direct dependency.
foreach ($dependent_entities as $entity) { foreach ($dependent_entities as $entity) {
$entities_to_check[] = $entity->getConfigDependencyName(); $entities_to_check[] = $entity->getConfigDependencyName();
} }
} }
$dependencies = array_merge($this->createGraphConfigEntityDependencies($entities_to_check), $dependent_entities); $dependencies = array_merge($this->createGraphConfigEntityDependencies($entities_to_check), $dependent_entities);
......
...@@ -191,7 +191,7 @@ protected function castValue($key, $value) { ...@@ -191,7 +191,7 @@ protected function castValue($key, $value) {
// we have to special case the meaning of an empty string for numeric // we have to special case the meaning of an empty string for numeric
// types. In PHP this would be casted to a 0 but for the purposes of // types. In PHP this would be casted to a 0 but for the purposes of
// configuration we need to treat this as a NULL. // configuration we need to treat this as a NULL.
$empty_value = $value === '' && ($element instanceof IntegerInterface || $element instanceof FloatInterface); $empty_value = $value === '' && ($element instanceof IntegerInterface || $element instanceof FloatInterface);
if ($value === NULL || $empty_value) { if ($value === NULL || $empty_value) {
$value = NULL; $value = NULL;
......
...@@ -819,7 +819,7 @@ public function __toString() { ...@@ -819,7 +819,7 @@ public function __toString() {
// Don't use the AS keyword for table aliases, as some // Don't use the AS keyword for table aliases, as some
// databases don't support it (e.g., Oracle). // databases don't support it (e.g., Oracle).
$query .= $table_string . ' ' . $this->connection->escapeTable($table['alias']); $query .= $table_string . ' ' . $this->connection->escapeTable($table['alias']);
if (!empty($table['condition'])) { if (!empty($table['condition'])) {
$query .= ' ON ' . $table['condition']; $query .= ' ON ' . $table['condition'];
......
...@@ -234,12 +234,12 @@ public function formatDiff($from, $to, $options = array()) { ...@@ -234,12 +234,12 @@ public function formatDiff($from, $to, $options = array()) {
switch ($value) { switch ($value) {
case 'y': case 'y':
$interval_output = $this->formatPlural($interval->y, '1 year', '@count years', array(), array('langcode' => $options['langcode'])); $interval_output = $this->formatPlural($interval->y, '1 year', '@count years', array(), array('langcode' => $options['langcode']));
$max_age = min($max_age, 365*86400); $max_age = min($max_age, 365 * 86400);
break; break;
case 'm': case 'm':
$interval_output = $this->formatPlural($interval->m, '1 month', '@count months', array(), array('langcode' => $options['langcode'])); $interval_output = $this->formatPlural($interval->m, '1 month', '@count months', array(), array('langcode' => $options['langcode']));
$max_age = min($max_age, 30*86400); $max_age = min($max_age, 30 * 86400);
break; break;
case 'd': case 'd':
...@@ -252,7 +252,7 @@ public function formatDiff($from, $to, $options = array()) { ...@@ -252,7 +252,7 @@ public function formatDiff($from, $to, $options = array()) {
$interval_output .= $this->formatPlural($weeks, '1 week', '@count weeks', array(), array('langcode' => $options['langcode'])); $interval_output .= $this->formatPlural($weeks, '1 week', '@count weeks', array(), array('langcode' => $options['langcode']));
$days -= $weeks * 7; $days -= $weeks * 7;
$granularity--; $granularity--;
$max_age = min($max_age, 7*86400); $max_age = min($max_age, 7 * 86400);
} }
if ((!$output || $weeks > 0) && $granularity > 0 && $days > 0) { if ((!$output || $weeks > 0) && $granularity > 0 && $days > 0) {
......
...@@ -88,7 +88,7 @@ public static function valueCallback(&$element, $input, FormStateInterface $form ...@@ -88,7 +88,7 @@ public static function valueCallback(&$element, $input, FormStateInterface $form
break; break;
case 'hour': case 'hour':
$format = in_array('ampm', $element['#date_part_order']) ? 'g': 'G'; $format = in_array('ampm', $element['#date_part_order']) ? 'g' : 'G';
break; break;
case 'minute': case 'minute':
...@@ -218,7 +218,7 @@ public static function processDatelist(&$element, FormStateInterface $form_state ...@@ -218,7 +218,7 @@ public static function processDatelist(&$element, FormStateInterface $form_state
break; break;
case 'hour': case 'hour':
$format = in_array('ampm', $element['#date_part_order']) ? 'g': 'G'; $format = in_array('ampm', $element['#date_part_order']) ? 'g' : 'G';
$options = $date_helper->hours($format, $element['#required']); $options = $date_helper->hours($format, $element['#required']);
$title = t('Hour'); $title = t('Hour');
break; break;
......
...@@ -50,7 +50,7 @@ public function process(ContainerBuilder $container) { ...@@ -50,7 +50,7 @@ public function process(ContainerBuilder $container) {
$root_namespace_dir = $namespaces[$root_namespace]; $root_namespace_dir = $namespaces[$root_namespace];
} }
$message =<<<EOF $message = <<<EOF
Missing proxy class '$proxy_class' for lazy service '$service_id'. Missing proxy class '$proxy_class' for lazy service '$service_id'.
Use the following command to generate the proxy class: Use the following command to generate the proxy class:
......
...@@ -305,7 +305,7 @@ protected function initializePager() { ...@@ -305,7 +305,7 @@ protected function initializePager() {
*/ */
public function tableSort(&$headers) { public function tableSort(&$headers) {
// If 'field' is not initialized, the header columns aren't clickable. // If 'field' is not initialized, the header columns aren't clickable.
foreach ($headers as $key =>$header) { foreach ($headers as $key => $header) {
if (is_array($header) && isset($header['specifier'])) { if (is_array($header) && isset($header['specifier'])) {
$headers[$key]['field'] = ''; $headers[$key]['field'] = '';
} }
......
...@@ -212,7 +212,7 @@ public function addField($field, $type, $langcode) { ...@@ -212,7 +212,7 @@ public function addField($field, $type, $langcode) {
$entity_type = $this->entityManager->getDefinition($entity_type_id); $entity_type = $this->entityManager->getDefinition($entity_type_id);
$field_storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id); $field_storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id);
// Add the new entity base table using the table and sql column. // Add the new entity base table using the table and sql column.
$join_condition= '%alias.' . $entity_type->getKey('id') . " = $table.$sql_column"; $join_condition = '%alias.' . $entity_type->getKey('id') . " = $table.$sql_column";
$base_table = $this->sqlQuery->leftJoin($entity_type->getBaseTable(), NULL, $join_condition); $base_table = $this->sqlQuery->leftJoin($entity_type->getBaseTable(), NULL, $join_condition);
$propertyDefinitions = array(); $propertyDefinitions = array();
$key++; $key++;
......
...@@ -201,7 +201,7 @@ public function getFieldColumnName(FieldStorageDefinitionInterface $storage_defi ...@@ -201,7 +201,7 @@ public function getFieldColumnName(FieldStorageDefinitionInterface $storage_defi
$field_name = $storage_definition->getName(); $field_name = $storage_definition->getName();
if ($this->allowsSharedTableStorage($storage_definition)) { if ($this->allowsSharedTableStorage($storage_definition)) {
$column_name = count($storage_definition->getColumns()) == 1 ? $field_name : $field_name . '__' . $property_name; $column_name = count($storage_definition->getColumns()) == 1 ? $field_name : $field_name . '__' . $property_name;
} }
elseif ($this->requiresDedicatedTableStorage($storage_definition)) { elseif ($this->requiresDedicatedTableStorage($storage_definition)) {
$column_name = !in_array($property_name, $this->getReservedColumns()) ? $field_name . '_' . $property_name : $property_name; $column_name = !in_array($property_name, $this->getReservedColumns()) ? $field_name . '_' . $property_name : $property_name;
......
...@@ -1174,7 +1174,7 @@ protected function saveToDedicatedTables(ContentEntityInterface $entity, $update ...@@ -1174,7 +1174,7 @@ protected function saveToDedicatedTables(ContentEntityInterface $entity, $update
$vid = $id; $vid = $id;
} }
$original = !empty($entity->original) ? $entity->original: NULL; $original = !empty($entity->original) ? $entity->original : NULL;
// Determine which fields should be actually stored. // Determine which fields should be actually stored.
$definitions = $this->entityManager->getFieldDefinitions($entity_type, $bundle); $definitions = $this->entityManager->getFieldDefinitions($entity_type, $bundle);
......
...@@ -1032,7 +1032,7 @@ public function doBuildForm($form_id, &$element, FormStateInterface &$form_state ...@@ -1032,7 +1032,7 @@ public function doBuildForm($form_id, &$element, FormStateInterface &$form_state
// Assign a decimal placeholder weight to preserve original array order. // Assign a decimal placeholder weight to preserve original array order.
if (!isset($element[$key]['#weight'])) { if (!isset($element[$key]['#weight'])) {
$element[$key]['#weight'] = $count/1000; $element[$key]['#weight'] = $count / 1000;
} }
else { else {
// If one of the child elements has a weight then we will need to sort // If one of the child elements has a weight then we will need to sort
......
...@@ -78,7 +78,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $install_ ...@@ -78,7 +78,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $install_
), ),
); );
$form['actions'] = array('#type' => 'actions'); $form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array( $form['actions']['submit'] = array(
'#type' => 'submit', '#type' => 'submit',
'#value' => 'Save and continue', '#value' => 'Save and continue',
'#button_type' => 'primary', '#button_type' => 'primary',
......
...@@ -72,7 +72,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $install_ ...@@ -72,7 +72,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $install_
$form['profile'][$profile_name]['#description'] = isset($profiles[$profile_name]['description']) ? $this->t($profiles[$profile_name]['description']) : ''; $form['profile'][$profile_name]['#description'] = isset($profiles[$profile_name]['description']) ? $this->t($profiles[$profile_name]['description']) : '';
} }
$form['actions'] = array('#type' => 'actions'); $form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array( $form['actions']['submit'] = array(
'#type' => 'submit', '#type' => 'submit',
'#value' => $this->t('Save and continue'), '#value' => $this->t('Save and continue'),
'#button_type' => 'primary', '#button_type' => 'primary',
......
...@@ -131,7 +131,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { ...@@ -131,7 +131,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
// distract from the message that the Drupal installation has completed // distract from the message that the Drupal installation has completed
// successfully.) // successfully.)
$post_params = $this->getRequest()->request->all(); $post_params = $this->getRequest()->request->all();
if (empty($post_params) && (!drupal_verify_install_file($this->root . '/' . $settings_file, FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE) || !drupal_verify_install_file($this->root . '/' . $settings_dir, FILE_NOT_WRITABLE, 'dir'))) { if (empty($post_params) && (!drupal_verify_install_file($this->root . '/' . $settings_file, FILE_EXIST | FILE_READABLE | FILE_NOT_WRITABLE) || !drupal_verify_install_file($this->root . '/' . $settings_dir, FILE_NOT_WRITABLE, 'dir'))) {
drupal_set_message(t('All necessary changes to %dir and %file have been made, so you should remove write permissions to them now in order to avoid security risks. If you are unsure how to do so, consult the <a href=":handbook_url">online handbook</a>.', array('%dir' => $settings_dir, '%file' => $settings_file, ':handbook_url' => 'https://www.drupal.org/server-permissions')), 'warning'); drupal_set_message(t('All necessary changes to %dir and %file have been made, so you should remove write permissions to them now in order to avoid security risks. If you are unsure how to do so, consult the <a href=":handbook_url">online handbook</a>.', array('%dir' => $settings_dir, '%file' => $settings_file, ':handbook_url' => 'https://www.drupal.org/server-permissions')), 'warning');
} }
......
...@@ -178,7 +178,7 @@ public function getTitle(LocalTaskInterface $local_task) { ...@@ -178,7 +178,7 @@ public function getTitle(LocalTaskInterface $local_task) {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getDefinitions() { public function getDefinitions() {
$definitions = parent::getDefinitions(); $definitions = parent::getDefinitions();
$count = 0; $count = 0;
foreach ($definitions as &$definition) { foreach ($definitions as &$definition) {
......
...@@ -187,7 +187,7 @@ protected function crypt($algo, $password, $setting) { ...@@ -187,7 +187,7 @@ protected function crypt($algo, $password, $setting) {
} while (--$count); } while (--$count);
$len = strlen($hash); $len = strlen($hash);
$output = $setting . $this->base64Encode($hash, $len); $output = $setting . $this->base64Encode($hash, $len);
// $this->base64Encode() of a 16 byte MD5 will always be 22 characters. // $this->base64Encode() of a 16 byte MD5 will always be 22 characters.
// $this->base64Encode() of a 64 byte sha512 will always be 86 characters. // $this->base64Encode() of a 64 byte sha512 will always be 86 characters.
$expected = 12 + ceil((8 * $len) / 6); $expected = 12 + ceil((8 * $len) / 6);
......
...@@ -65,7 +65,7 @@ public static function valueCallback(&$element, $input, FormStateInterface $form ...@@ -65,7 +65,7 @@ public static function valueCallback(&$element, $input, FormStateInterface $form
* Expand a password_confirm field into two text boxes. * Expand a password_confirm field into two text boxes.
*/ */
public static function processPasswordConfirm(&$element, FormStateInterface $form_state, &$complete_form) { public static function processPasswordConfirm(&$element, FormStateInterface $form_state, &$complete_form) {
$element['pass1'] = array( $element['pass1'] = array(
'#type' => 'password', '#type' => 'password',
'#title' => t('Password'), '#title' => t('Password'),
'#value' => empty($element['#value']) ? NULL : $element['#value']['pass1'], '#value' => empty($element['#value']) ? NULL : $element['#value']['pass1'],
...@@ -73,7 +73,7 @@ public static function processPasswordConfirm(&$element, FormStateInterface $for ...@@ -73,7 +73,7 @@ public static function processPasswordConfirm(&$element, FormStateInterface $for
'#attributes' => array('class' => array('password-field', 'js-password-field')), '#attributes' => array('class' => array('password-field', 'js-password-field')),
'#error_no_message' => TRUE, '#error_no_message' => TRUE,
); );
$element['pass2'] = array( $element['pass2'] = array(
'#type' => 'password', '#type' => 'password',
'#title' => t('Confirm password'), '#title' => t('Confirm password'),
'#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'], '#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'],
......
...@@ -96,7 +96,7 @@ public static function getFit($path) { ...@@ -96,7 +96,7 @@ public static function getFit($path) {
$fit = 0; $fit = 0;
foreach ($parts as $k => $part) { foreach ($parts as $k => $part) {
if (strpos($part, '{') === FALSE) { if (strpos($part, '{') === FALSE) {
$fit |= 1 << ($slashes - $k); $fit |= 1 << ($slashes - $k);
} }
} }
......
...@@ -76,11 +76,11 @@ public function stream_open($uri, $mode, $options, &$opened_path) { ...@@ -76,11 +76,11 @@ public function stream_open($uri, $mode, $options, &$opened_path) {
*/ */
public function stream_lock($operation) { public function stream_lock($operation) {
// Disallow exclusive lock or non-blocking lock requests // Disallow exclusive lock or non-blocking lock requests
if (in_array($operation, array(LOCK_EX, LOCK_EX|LOCK_NB))) { if (in_array($operation, array(LOCK_EX, LOCK_EX | LOCK_NB))) {
trigger_error('stream_lock() exclusive lock operations not supported for read-only stream wrappers', E_USER_WARNING); trigger_error('stream_lock() exclusive lock operations not supported for read-only stream wrappers', E_USER_WARNING);
return FALSE; return FALSE;
} }
if (in_array($operation, array(LOCK_SH, LOCK_UN, LOCK_SH|LOCK_NB))) { if (in_array($operation, array(LOCK_SH, LOCK_UN, LOCK_SH | LOCK_NB))) {
return flock($this->handle, $operation); return flock($this->handle, $operation);
} }
......
...@@ -111,11 +111,11 @@ public function stream_open($uri, $mode, $options, &$opened_path) { ...@@ -111,11 +111,11 @@ public function stream_open($uri, $mode, $options, &$opened_path) {
* @see http://php.net/manual/streamwrapper.stream-lock.php * @see http://php.net/manual/streamwrapper.stream-lock.php
*/ */
public function stream_lock($operation) { public function stream_lock($operation) {
if (in_array($operation, array(LOCK_EX, LOCK_EX|LOCK_NB))) { if (in_array($operation, array(LOCK_EX, LOCK_EX | LOCK_NB))) {
trigger_error('stream_lock() exclusive lock operations not supported for read-only stream wrappers', E_USER_WARNING); trigger_error('stream_lock() exclusive lock operations not supported for read-only stream wrappers', E_USER_WARNING);
return FALSE; return FALSE;
} }
if (in_array($operation, array(LOCK_SH, LOCK_UN, LOCK_SH|LOCK_NB))) { if (in_array($operation, array(LOCK_SH, LOCK_UN, LOCK_SH | LOCK_NB))) {
return flock($this->handle, $operation); return flock($this->handle, $operation);
} }
......
...@@ -50,7 +50,7 @@ function aggregator_help($route_name, RouteMatchInterface $route_match) { ...@@ -50,7 +50,7 @@ function aggregator_help($route_name, RouteMatchInterface $route_match) {
case 'aggregator.admin_overview': case 'aggregator.admin_overview':
// Don't use placeholders for possibility to change URLs for translators. // Don't use placeholders for possibility to change URLs for translators.
$output = '<p>' . t('Many sites publish their headlines and posts in feeds, using a number of standardized XML-based formats. The aggregator supports <a href="http://en.wikipedia.org/wiki/Rss">RSS</a>, <a href="http://en.wikipedia.org/wiki/Resource_Description_Framework">RDF</a>, and <a href="http://en.wikipedia.org/wiki/Atom_%28standard%29">Atom</a>.') . '</p>'; $output = '<p>' . t('Many sites publish their headlines and posts in feeds, using a number of standardized XML-based formats. The aggregator supports <a href="http://en.wikipedia.org/wiki/Rss">RSS</a>, <a href="http://en.wikipedia.org/wiki/Resource_Description_Framework">RDF</a>, and <a href="http://en.wikipedia.org/wiki/Atom_%28standard%29">Atom</a>.') . '</p>';
$output .= '<p>' . t('Current feeds are listed below, and <a href=":addfeed">new feeds may be added</a>. For each feed, the <em>latest items</em> block may be enabled at the <a href=":block">blocks administration page</a>.', array(':addfeed' => \Drupal::url('aggregator.feed_add'), ':block' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#')) . '</p>'; $output .= '<p>' . t('Current feeds are listed below, and <a href=":addfeed">new feeds may be added</a>. For each feed, the <em>latest items</em> block may be enabled at the <a href=":block">blocks administration page</a>.', array(':addfeed' => \Drupal::url('aggregator.feed_add'), ':block' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#')) . '</p>';
return $output; return $output;
case 'aggregator.feed_add': case 'aggregator.feed_add':
......
...@@ -75,7 +75,7 @@ public function testStringFormatter() { ...@@ -75,7 +75,7 @@ public function testStringFormatter() {
$this->assertNotContains($aggregator_feed->getUrl(), $result); $this->assertNotContains($aggregator_feed