Commit d5d0d6ce authored by alexpott's avatar alexpott
Browse files

Issue #2572777 by andypost, alexpott, attiks, andriyun: Fix...

Issue #2572777 by andypost, alexpott, attiks, andriyun: Fix 'Squiz.Strings.ConcatenationSpacing' coding standard
parent e0c2d965
...@@ -181,7 +181,7 @@ function _drupal_log_error($error, $fatal = FALSE) { ...@@ -181,7 +181,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
if ($fatal) { if ($fatal) {
// When called from CLI, simply output a plain text message. // When called from CLI, simply output a plain text message.
// Should not translate the string to avoid errors producing more errors. // Should not translate the string to avoid errors producing more errors.
$response->setContent(html_entity_decode(strip_tags(SafeMarkup::format('%type: @message in %function (line %line of %file).', $error))). "\n"); $response->setContent(html_entity_decode(strip_tags(SafeMarkup::format('%type: @message in %function (line %line of %file).', $error))) . "\n");
$response->send(); $response->send();
exit; exit;
} }
......
...@@ -227,7 +227,7 @@ function drupal_rewrite_settings($settings = array(), $settings_file = NULL) { ...@@ -227,7 +227,7 @@ function drupal_rewrite_settings($settings = array(), $settings_file = NULL) {
else { else {
_drupal_rewrite_settings_global($settings_settings, $data); _drupal_rewrite_settings_global($settings_settings, $data);
} }
$variable_names['$'. $setting] = $setting; $variable_names['$' . $setting] = $setting;
} }
$contents = file_get_contents($settings_file); $contents = file_get_contents($settings_file);
if ($contents !== FALSE) { if ($contents !== 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);
} }
......
...@@ -593,7 +593,7 @@ protected function getParameterAlternatives($name) { ...@@ -593,7 +593,7 @@ protected function getParameterAlternatives($name) {
*/ */
public function enterScope($name) { public function enterScope($name) {
if ('request' !== $name) { if ('request' !== $name) {
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
} }
throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__)); throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__));
...@@ -604,7 +604,7 @@ public function enterScope($name) { ...@@ -604,7 +604,7 @@ public function enterScope($name) {
*/ */
public function leaveScope($name) { public function leaveScope($name) {
if ('request' !== $name) { if ('request' !== $name) {
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
} }
throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__)); throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__));
...@@ -617,7 +617,7 @@ public function addScope(ScopeInterface $scope) { ...@@ -617,7 +617,7 @@ public function addScope(ScopeInterface $scope) {
$name = $scope->getName(); $name = $scope->getName();
if ('request' !== $name) { if ('request' !== $name) {
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
} }
throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__)); throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__));
} }
...@@ -627,7 +627,7 @@ public function addScope(ScopeInterface $scope) { ...@@ -627,7 +627,7 @@ public function addScope(ScopeInterface $scope) {
*/ */
public function hasScope($name) { public function hasScope($name) {
if ('request' !== $name) { if ('request' !== $name) {
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
} }
throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__)); throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__));
...@@ -637,7 +637,7 @@ public function hasScope($name) { ...@@ -637,7 +637,7 @@ public function hasScope($name) {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function isScopeActive($name) { public function isScopeActive($name) {
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__)); throw new \BadMethodCallException(sprintf("'%s' is not supported by Drupal 8.", __FUNCTION__));
} }
......
...@@ -251,7 +251,7 @@ public function sentences($min_word_count, $capitalize = FALSE) { ...@@ -251,7 +251,7 @@ public function sentences($min_word_count, $capitalize = FALSE) {
public function paragraphs($paragraph_count = 12) { public function paragraphs($paragraph_count = 12) {
$output = ''; $output = '';
for ($i = 1; $i <= $paragraph_count; $i++) { for ($i = 1; $i <= $paragraph_count; $i++) {
$output .= $this->sentences(mt_rand(20, 60)) ."\n\n"; $output .= $this->sentences(mt_rand(20, 60)) . "\n\n";
} }
return $output; return $output;
} }
...@@ -291,7 +291,7 @@ public function image($destination, $min_resolution, $max_resolution) { ...@@ -291,7 +291,7 @@ public function image($destination, $min_resolution, $max_resolution) {
$smaller_dimension = ($smaller_dimension % 2) ? $smaller_dimension : $smaller_dimension; $smaller_dimension = ($smaller_dimension % 2) ? $smaller_dimension : $smaller_dimension;
imageellipse($im, $width / 2, $height / 2, $smaller_dimension, $smaller_dimension, $color); imageellipse($im, $width / 2, $height / 2, $smaller_dimension, $smaller_dimension, $color);
$save_function = 'image'. ($extension == 'jpg' ? 'jpeg' : $extension); $save_function = 'image' . ($extension == 'jpg' ? 'jpeg' : $extension);
$save_function($im, $destination); $save_function($im, $destination);
return $destination; return $destination;
} }
......
...@@ -19,7 +19,7 @@ class AssetDumper implements AssetDumperInterface { ...@@ -19,7 +19,7 @@ class AssetDumper implements AssetDumperInterface {
public function dump($data, $file_extension) { public function dump($data, $file_extension) {
// Prefix filename to prevent blocking by firewalls which reject files // Prefix filename to prevent blocking by firewalls which reject files
// starting with "ad*". // starting with "ad*".
$filename = $file_extension. '_' . Crypt::hashBase64($data) . '.' . $file_extension; $filename = $file_extension . '_' . Crypt::hashBase64($data) . '.' . $file_extension;
// Create the css/ or js/ path within the files folder. // Create the css/ or js/ path within the files folder.
$path = 'public://' . $file_extension; $path = 'public://' . $file_extension;
$uri = $path . '/' . $filename; $uri = $path . '/' . $filename;
......
...@@ -163,7 +163,7 @@ protected function loadNestedFile($matches) { ...@@ -163,7 +163,7 @@ protected function loadNestedFile($matches) {
$directory = dirname($filename); $directory = dirname($filename);
// If the file is in the current directory, make sure '.' doesn't appear in // If the file is in the current directory, make sure '.' doesn't appear in
// the url() path. // the url() path.
$directory = $directory == '.' ? '' : $directory .'/'; $directory = $directory == '.' ? '' : $directory . '/';
// Alter all internal url() paths. Leave external paths alone. We don't need // Alter all internal url() paths. Leave external paths alone. We don't need
// to normalize absolute paths here because that will be done later. // to normalize absolute paths here because that will be done later.
......
...@@ -442,7 +442,7 @@ public function groupBy($field, $langcode = NULL) { ...@@ -442,7 +442,7 @@ public function groupBy($field, $langcode = NULL) {
* The alias for the field. * The alias for the field.
*/ */
protected function getAggregationAlias($field, $function) { protected function getAggregationAlias($field, $function) {
return strtolower($field . '_'. $function); return strtolower($field . '_' . $function);
} }
/** /**
......
...@@ -188,7 +188,7 @@ protected function doGenerate(array $variables, array $defaults, array $tokens, ...@@ -188,7 +188,7 @@ protected function doGenerate(array $variables, array $defaults, array $tokens,
if ('variable' === $token[0]) { if ('variable' === $token[0]) {
if (!$optional || !array_key_exists($token[3], $defaults) || (isset($mergedParams[$token[3]]) && (string) $mergedParams[$token[3]] !== (string) $defaults[$token[3]])) { if (!$optional || !array_key_exists($token[3], $defaults) || (isset($mergedParams[$token[3]]) && (string) $mergedParams[$token[3]] !== (string) $defaults[$token[3]])) {
// check requirement // check requirement
if (!preg_match('#^'.$token[2].'$#', $mergedParams[$token[3]])) { if (!preg_match('#^' . $token[2] . '$#', $mergedParams[$token[3]])) {
$message = sprintf('Parameter "%s" for route "%s" must match "%s" ("%s" given) to generate a corresponding URL.', $token[3], $name, $token[2], $mergedParams[$token[3]]); $message = sprintf('Parameter "%s" for route "%s" must match "%s" ("%s" given) to generate a corresponding URL.', $token[3], $name, $token[2], $mergedParams[$token[3]]);
throw new InvalidParameterException($message); throw new InvalidParameterException($message);
} }
...@@ -232,7 +232,7 @@ protected function doGenerate(array $variables, array $defaults, array $tokens, ...@@ -232,7 +232,7 @@ protected function doGenerate(array $variables, array $defaults, array $tokens,
if ($query_params && $query = http_build_query($query_params, '', '&')) { if ($query_params && $query = http_build_query($query_params, '', '&')) {
// "/" and "?" can be left decoded for better user experience, see // "/" and "?" can be left decoded for better user experience, see
// http://tools.ietf.org/html/rfc3986#section-3.4 // http://tools.ietf.org/html/rfc3986#section-3.4
$url .= '?'.strtr($query, array('%2F' => '/')); $url .= '?' . strtr($query, array('%2F' => '/'));
} }
return $url; return $url;
......
...@@ -138,7 +138,7 @@ public function prepareRow(Row $row) { ...@@ -138,7 +138,7 @@ public function prepareRow(Row $row) {
$settings['book']['block_mode'] = $this->variableGet('book_block_mode', 'all pages'); $settings['book']['block_mode'] = $this->variableGet('book_block_mode', 'all pages');
break; break;
case 'forum': case 'forum':
$settings['forum']['block_num'] = $this->variableGet('forum_block_num_'. $delta, 5); $settings['forum']['block_num'] = $this->variableGet('forum_block_num_' . $delta, 5);
break; break;
case 'statistics': case 'statistics':
foreach (array('statistics_block_top_day_num', 'statistics_block_top_all_num', 'statistics_block_top_last_num') as $name) { foreach (array('statistics_block_top_day_num', 'statistics_block_top_all_num', 'statistics_block_top_last_num') as $name) {
......
...@@ -25,12 +25,12 @@ function block_content_test_block_content_view(array &$build, BlockContent $bloc ...@@ -25,12 +25,12 @@ function block_content_test_block_content_view(array &$build, BlockContent $bloc
*/ */
function block_content_test_block_content_presave(BlockContent $block_content) { function block_content_test_block_content_presave(BlockContent $block_content) {
if ($block_content->label() == 'testing_block_content_presave') { if ($block_content->label() == 'testing_block_content_presave') {
$block_content->setInfo($block_content->label() .'_presave'); $block_content->setInfo($block_content->label() . '_presave');
} }
// Determine changes. // Determine changes.
if (!empty($block_content->original) && $block_content->original->label() == 'test_changes') { if (!empty($block_content->original) && $block_content->original->label() == 'test_changes') {
if ($block_content->original->label() != $block_content->label()) { if ($block_content->original->label() != $block_content->label()) {
$block_content->setInfo($block_content->label() .'_presave'); $block_content->setInfo($block_content->label() . '_presave');
// Drupal 1.0 release. // Drupal 1.0 release.
$block_content->changed = 979534800; $block_content->changed = 979534800;
} }
...@@ -44,7 +44,7 @@ function block_content_test_block_content_update(BlockContent $block_content) { ...@@ -44,7 +44,7 @@ function block_content_test_block_content_update(BlockContent $block_content) {
// Determine changes on update. // Determine changes on update.
if (!empty($block_content->original) && $block_content->original->label() == 'test_changes') { if (!empty($block_content->original) && $block_content->original->label() == 'test_changes') {
if ($block_content->original->label() != $block_content->label()) { if ($block_content->original->label() != $block_content->label()) {
$block_content->setInfo($block_content->label() .'_update'); $block_content->setInfo($block_content->label() . '_update');
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment