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
......@@ -225,10 +225,10 @@ function testNodeTermCreationAndDeletion() {
// three letters.
// @see https://www.drupal.org/node/2397691
$terms = array(
'term1' => 'a'. $this->randomMachineName(),
'term2' => 'b'. $this->randomMachineName(),
'term3' => 'c'. $this->randomMachineName() . ', ' . $this->randomMachineName(),
'term4' => 'd'. $this->randomMachineName(),
'term1' => 'a' . $this->randomMachineName(),
'term2' => 'b' . $this->randomMachineName(),
'term3' => 'c' . $this->randomMachineName() . ', ' . $this->randomMachineName(),
'term4' => 'd' . $this->randomMachineName(),
);
$edit = array();
......
......@@ -60,7 +60,7 @@ public function testTermPath() {
*/
public function testTermTitleEscaping() {
$this->term1->setName('<em>Markup</em>')->save();
$this->drupalGet('taxonomy_default_argument_test/'. $this->term1->id());
$this->drupalGet('taxonomy_default_argument_test/' . $this->term1->id());
$this->assertEscaped($this->term1->label());
}
......
......@@ -267,7 +267,7 @@ function testLocaleTranslationSubtreesHashCacheClear() {
t($name, array(), array('langcode' => $langcode));
// Reset locale cache.
$this->container->get('string_translation')->reset();
$this->assertRaw('"edit-languages-' . $langcode .'-weight"', 'Language code found.');
$this->assertRaw('"edit-languages-' . $langcode . '-weight"', 'Language code found.');
$this->assertText(t($name), 'Test language added.');
// Have the adminUser request a page in the new language.
......
......@@ -387,8 +387,8 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
$user = $this->getEntity($form_state);
// If there's a session set to the users id, remove the password reset tag
// since a new password was saved.
if (isset($_SESSION['pass_reset_'. $user->id()])) {
unset($_SESSION['pass_reset_'. $user->id()]);
if (isset($_SESSION['pass_reset_' . $user->id()])) {
unset($_SESSION['pass_reset_' . $user->id()]);
}
}
}
......@@ -31,15 +31,24 @@ public function validate($items, Constraint $constraint) {
}
if (preg_match('/[^\x{80}-\x{F7} a-z0-9@_.\'-]/i', $name)
|| preg_match(
'/[\x{80}-\x{A0}' . // Non-printable ISO-8859-1 + NBSP
'\x{AD}' . // Soft-hyphen
'\x{2000}-\x{200F}' . // Various space characters
'\x{2028}-\x{202F}' . // Bidirectional text overrides
'\x{205F}-\x{206F}' . // Various text hinting characters
'\x{FEFF}' . // Byte order mark
'\x{FF01}-\x{FF60}' . // Full-width latin
'\x{FFF9}-\x{FFFD}' . // Replacement characters
'\x{0}-\x{1F}]/u', // NULL byte and control characters
// Non-printable ISO-8859-1 + NBSP
'/[\x{80}-\x{A0}' .
// Soft-hyphen
'\x{AD}' .
// Various space characters
'\x{2000}-\x{200F}' .
// Bidirectional text overrides
'\x{2028}-\x{202F}' .
// Various text hinting characters
'\x{205F}-\x{206F}' .
// Byte order mark
'\x{FEFF}' .
// Full-width latin
'\x{FF01}-\x{FF60}' .
// Replacement characters
'\x{FFF9}-\x{FFFD}' .
// NULL byte and control characters
'\x{0}-\x{1F}]/u',
$name)
) {
$this->context->addViolation($constraint->illegalMessage);
......
......@@ -58,7 +58,7 @@ public function query($group_by = FALSE) {
$this->ensureMyTable();
// Now that our table is secure, get our formula.
$placeholder = $this->placeholder();
$formula = $this->getFormula() .' = ' . $placeholder;
$formula = $this->getFormula() . ' = ' . $placeholder;
$placeholders = array(
$placeholder => $this->argument,
);
......
......@@ -137,7 +137,7 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) {
foreach ($custom_fields as $field) {
$cache_options = $form_state->getValue('cache_options');
if ($cache_options[$field] == 'custom' && !is_numeric($cache_options[$field . '_custom'])) {
$form_state->setError($form[$field .'_custom'], $this->t('Custom time values must be numeric.'));
$form_state->setError($form[$field . '_custom'], $this->t('Custom time values must be numeric.'));
}
}
}
......
......@@ -203,8 +203,8 @@ protected function leftQuery($options) {
}
// Get the namespace string.
$temp_view->namespace = (!empty($options['subquery_namespace'])) ? '_'. $options['subquery_namespace'] : '_INNER';
$this->subquery_namespace = (!empty($options['subquery_namespace'])) ? '_'. $options['subquery_namespace'] : 'INNER';
$temp_view->namespace = (!empty($options['subquery_namespace'])) ? '_' . $options['subquery_namespace'] : '_INNER';
$this->subquery_namespace = (!empty($options['subquery_namespace'])) ? '_' . $options['subquery_namespace'] : 'INNER';
// The value we add here does nothing, but doing this adds the right tables
// and puts in a WHERE clause with a placeholder we can grab later.
......
......@@ -58,7 +58,7 @@ public function testUI() {
$types = array('header', 'footer', 'empty');
$labels = array();
foreach ($types as $type) {
$edit_path = 'admin/structure/views/nojs/handler/test_example_area/default/' . $type .'/test_example';
$edit_path = 'admin/structure/views/nojs/handler/test_example_area/default/' . $type . '/test_example';
// First setup an empty label.
$this->drupalPostForm($edit_path, array(), t('Apply'));
......
......@@ -117,7 +117,7 @@ protected function executeView($view, array $args = array()) {
$view->setDisplay();
$view->preExecute($args);
$view->execute();
$verbose_message = '<pre>Executed view: ' . ((string) $view->build_info['query']). '</pre>';
$verbose_message = '<pre>Executed view: ' . ((string) $view->build_info['query']) . '</pre>';
if ($view->build_info['query'] instanceof SelectInterface) {
$verbose_message .= '<pre>Arguments: ' . print_r($view->build_info['query']->getArguments(), TRUE) . '</pre>';
}
......
......@@ -118,7 +118,7 @@ protected function executeView(ViewExecutable $view, $args = array()) {
$view->setDisplay();
$view->preExecute($args);
$view->execute();
$verbose_message = '<pre>Executed view: ' . ((string) $view->build_info['query']). '</pre>';
$verbose_message = '<pre>Executed view: ' . ((string) $view->build_info['query']) . '</pre>';
if ($view->build_info['query'] instanceof SelectInterface) {
$verbose_message .= '<pre>Arguments: ' . print_r($view->build_info['query']->getArguments(), TRUE) . '</pre>';
}
......
......@@ -120,7 +120,7 @@ protected function executeView($view, array $args = []) {
$view->setDisplay();
$view->preExecute($args);
$view->execute();
$verbose_message = '<pre>Executed view: ' . ((string) $view->build_info['query']). '</pre>';
$verbose_message = '<pre>Executed view: ' . ((string) $view->build_info['query']) . '</pre>';
if ($view->build_info['query'] instanceof SelectInterface) {
$verbose_message .= '<pre>Arguments: ' . print_r($view->build_info['query']->getArguments(), TRUE) . '</pre>';
}
......
......@@ -189,7 +189,7 @@ function views_theme($existing, $type, $theme, $path) {
// Whenever we have a theme file, we include it directly so we can
// auto-detect the theme function.
if (isset($def['theme_file'])) {
$include = \Drupal::root() . '/' . $module_dir. '/' . $def['theme_file'];
$include = \Drupal::root() . '/' . $module_dir . '/' . $def['theme_file'];
if (is_file($include)) {
require_once $include;
}
......
......@@ -35,7 +35,7 @@ public function testAddDisplay() {
$settings['page[create]'] = FALSE;
$view = $this->randomView($settings);
$path_prefix = 'admin/structure/views/view/' . $view['id'] .'/edit';
$path_prefix = 'admin/structure/views/view/' . $view['id'] . '/edit';
$this->drupalGet($path_prefix);
// Add a new display.
......@@ -54,7 +54,7 @@ public function testAddDisplay() {
*/
public function testRemoveDisplay() {
$view = $this->randomView();
$path_prefix = 'admin/structure/views/view/' . $view['id'] .'/edit';
$path_prefix = 'admin/structure/views/view/' . $view['id'] . '/edit';
$this->drupalGet($path_prefix . '/default');
$this->assertNoFieldById('edit-displays-settings-settings-content-tab-content-details-top-actions-delete', 'Delete Page', 'Make sure there is no delete button on the default display.');
......@@ -97,7 +97,7 @@ public function testDefaultDisplay() {
*/
public function testDuplicateDisplay() {
$view = $this->randomView();
$path_prefix = 'admin/structure/views/view/' . $view['id'] .'/edit';
$path_prefix = 'admin/structure/views/view/' . $view['id'] . '/edit';
$path = $view['page[path]'];
$this->drupalGet($path_prefix);
......
......@@ -89,7 +89,7 @@ public function testReorderDisplay() {
*/
public function testDisableDisplay() {
$view = $this->randomView();
$path_prefix = 'admin/structure/views/view/' . $view['id'] .'/edit';
$path_prefix = 'admin/structure/views/view/' . $view['id'] . '/edit';
$this->drupalGet($path_prefix);
$this->assertFalse($this->xpath('//div[contains(@class, :class)]', array(':class' => 'views-display-disabled')), 'Make sure the disabled display css class does not appear after initial adding of a view.');
......
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