Commit db5e8289 authored by xjm's avatar xjm

Issue #2572787 by alexpott, mfernea, attiks, andriyun, andypost, RoSk0,...

Issue #2572787 by alexpott, mfernea, attiks, andriyun, andypost, RoSk0, hussainweb, klausi, martin107: Fix 'Drupal.WhiteSpace.CloseBracketSpacing' coding standard
parent 2fc85e7f
...@@ -50,7 +50,7 @@ public function compile($configs) { ...@@ -50,7 +50,7 @@ public function compile($configs) {
// matter and this config object does not match. // matter and this config object does not match.
// If OR and it is matching, then the rest of conditions do not // If OR and it is matching, then the rest of conditions do not
// matter and this config object does match. // matter and this config object does match.
if ($and != $match ) { if ($and != $match) {
break; break;
} }
} }
......
...@@ -133,7 +133,7 @@ public function listAll($prefix = '') { ...@@ -133,7 +133,7 @@ public function listAll($prefix = '') {
else { else {
$return = []; $return = [];
foreach ($names as $index => $name) { foreach ($names as $index => $name) {
if (strpos($name, $prefix) === 0 ) { if (strpos($name, $prefix) === 0) {
$return[$index] = $names[$index]; $return[$index] = $names[$index];
} }
} }
......
...@@ -254,7 +254,7 @@ public function initializeDatabase() { ...@@ -254,7 +254,7 @@ public function initializeDatabase() {
\'SELECT random();\' \'SELECT random();\'
LANGUAGE \'sql\'', LANGUAGE \'sql\'',
[], [],
['allow_delimiter_in_query' => TRUE ] ['allow_delimiter_in_query' => TRUE]
); );
} }
...@@ -263,7 +263,7 @@ public function initializeDatabase() { ...@@ -263,7 +263,7 @@ public function initializeDatabase() {
\'SELECT array_to_string((string_to_array($1, $2)) [1:$3], $2);\' \'SELECT array_to_string((string_to_array($1, $2)) [1:$3], $2);\'
LANGUAGE \'sql\'', LANGUAGE \'sql\'',
[], [],
['allow_delimiter_in_query' => TRUE ] ['allow_delimiter_in_query' => TRUE]
); );
} }
$connection->query('SELECT pg_advisory_unlock(1)'); $connection->query('SELECT pg_advisory_unlock(1)');
......
...@@ -192,7 +192,7 @@ protected function _changed($orig, $closing) { ...@@ -192,7 +192,7 @@ protected function _changed($orig, $closing) {
// Notice that WordLevelDiff returns HTML-escaped output. Hence, we will be // Notice that WordLevelDiff returns HTML-escaped output. Hence, we will be
// calling addedLine/deletedLine without HTML-escaping. // calling addedLine/deletedLine without HTML-escaping.
while ($line = array_shift($del)) { while ($line = array_shift($del)) {
$aline = array_shift($add ); $aline = array_shift($add);
$this->rows[] = array_merge($this->deletedLine($line), isset($aline) ? $this->addedLine($aline) : $this->emptyLine()); $this->rows[] = array_merge($this->deletedLine($line), isset($aline) ? $this->addedLine($aline) : $this->emptyLine());
} }
......
...@@ -313,7 +313,7 @@ public function __construct($definition) { ...@@ -313,7 +313,7 @@ public function __construct($definition) {
// Automatically add the EntityChanged constraint if the entity type tracks // Automatically add the EntityChanged constraint if the entity type tracks
// the changed time. // the changed time.
if ($this->entityClassImplements(EntityChangedInterface::class) ) { if ($this->entityClassImplements(EntityChangedInterface::class)) {
$this->addConstraint('EntityChanged'); $this->addConstraint('EntityChanged');
} }
......
...@@ -46,7 +46,7 @@ class EntityAdapter extends TypedData implements \IteratorAggregate, ComplexData ...@@ -46,7 +46,7 @@ class EntityAdapter extends TypedData implements \IteratorAggregate, ComplexData
public static function createFromEntity(EntityInterface $entity) { public static function createFromEntity(EntityInterface $entity) {
$definition = EntityDataDefinition::create() $definition = EntityDataDefinition::create()
->setEntityTypeId($entity->getEntityTypeId()) ->setEntityTypeId($entity->getEntityTypeId())
->setBundles([$entity->bundle() ]); ->setBundles([$entity->bundle()]);
$instance = new static($definition); $instance = new static($definition);
$instance->setValue($entity); $instance->setValue($entity);
return $instance; return $instance;
......
...@@ -226,7 +226,7 @@ public function getModuleUpdateFunctions($module_name) { ...@@ -226,7 +226,7 @@ public function getModuleUpdateFunctions($module_name) {
$all_functions = $this->getAvailableUpdateFunctions(); $all_functions = $this->getAvailableUpdateFunctions();
return array_filter($all_functions, function ($function_name) use ($module_name) { return array_filter($all_functions, function ($function_name) use ($module_name) {
list($function_module_name, ) = explode("_{$this->updateType}_", $function_name); list($function_module_name,) = explode("_{$this->updateType}_", $function_name);
return $function_module_name === $module_name; return $function_module_name === $module_name;
}); });
} }
......
...@@ -27,7 +27,7 @@ public function testActionUninstall() { ...@@ -27,7 +27,7 @@ public function testActionUninstall() {
$storage = $this->container->get('entity_type.manager')->getStorage('action'); $storage = $this->container->get('entity_type.manager')->getStorage('action');
$storage->resetCache(['user_block_user_action']); $storage->resetCache(['user_block_user_action']);
$this->assertTrue($storage->load('user_block_user_action'), 'Configuration entity \'user_block_user_action\' still exists after uninstalling action module.' ); $this->assertTrue($storage->load('user_block_user_action'), 'Configuration entity \'user_block_user_action\' still exists after uninstalling action module.');
$admin_user = $this->drupalCreateUser(['administer users']); $admin_user = $this->drupalCreateUser(['administer users']);
$this->drupalLogin($admin_user); $this->drupalLogin($admin_user);
......
...@@ -61,7 +61,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI ...@@ -61,7 +61,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
* @param \Drupal\Core\Plugin\Context\ContextRepositoryInterface $context_repository * @param \Drupal\Core\Plugin\Context\ContextRepositoryInterface $context_repository
* The lazy context repository service. * The lazy context repository service.
*/ */
public function __construct(EntityTypeInterface $entity_type, ContextHandlerInterface $context_handler, ContextRepositoryInterface $context_repository ) { public function __construct(EntityTypeInterface $entity_type, ContextHandlerInterface $context_handler, ContextRepositoryInterface $context_repository) {
parent::__construct($entity_type); parent::__construct($entity_type);
$this->contextHandler = $context_handler; $this->contextHandler = $context_handler;
$this->contextRepository = $context_repository; $this->contextRepository = $context_repository;
......
...@@ -15,7 +15,7 @@ class Textarea extends FormElementBase { ...@@ -15,7 +15,7 @@ class Textarea extends FormElementBase {
public function getTranslationElement(LanguageInterface $translation_language, $source_config, $translation_config) { public function getTranslationElement(LanguageInterface $translation_language, $source_config, $translation_config) {
// Estimate a comfortable size of the input textarea. // Estimate a comfortable size of the input textarea.
$rows_words = ceil(str_word_count($translation_config) / 5); $rows_words = ceil(str_word_count($translation_config) / 5);
$rows_newlines = substr_count($translation_config, "\n" ) + 1; $rows_newlines = substr_count($translation_config, "\n") + 1;
$rows = max($rows_words, $rows_newlines); $rows = max($rows_words, $rows_newlines);
return [ return [
......
...@@ -347,7 +347,7 @@ public function testDeleteNoData() { ...@@ -347,7 +347,7 @@ public function testDeleteNoData() {
FieldConfig::create($field_definition)->save(); FieldConfig::create($field_definition)->save();
$field_storage = FieldStorageConfig::load('entity_test.' . $field_storage_definition['field_name']); $field_storage = FieldStorageConfig::load('entity_test.' . $field_storage_definition['field_name']);
$this->assertTrue(!empty($field_storage) && !$field_storage->isDeleted(), 'A new storage with a previously used name is created.'); $this->assertTrue(!empty($field_storage) && !$field_storage->isDeleted(), 'A new storage with a previously used name is created.');
$field = FieldConfig::load('entity_test.' . $field_definition['bundle'] . '.' . $field_definition['field_name'] ); $field = FieldConfig::load('entity_test.' . $field_definition['bundle'] . '.' . $field_definition['field_name']);
$this->assertTrue(!empty($field) && !$field->isDeleted(), 'A new field for a previously used field name is created.'); $this->assertTrue(!empty($field) && !$field->isDeleted(), 'A new field for a previously used field name is created.');
// Save an entity with data for the field // Save an entity with data for the field
......
...@@ -135,7 +135,7 @@ public function testMarkFieldForDeletion() { ...@@ -135,7 +135,7 @@ public function testMarkFieldForDeletion() {
], ],
'field_test_text' => [], 'field_test_text' => [],
]; ];
$entity = $this->serializer->denormalize($data, get_class($entity), $this->format, ['target_instance' => $entity ]); $entity = $this->serializer->denormalize($data, get_class($entity), $this->format, ['target_instance' => $entity]);
$this->assertEqual($entity->field_test_text->count(), 0); $this->assertEqual($entity->field_test_text->count(), 0);
} }
......
...@@ -193,7 +193,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s ...@@ -193,7 +193,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s
$this->drupalGet($generate_url_noaccess); $this->drupalGet($generate_url_noaccess);
$this->assertResponse(403, 'Confirmed that access is denied for the private image style.'); $this->assertResponse(403, 'Confirmed that access is denied for the private image style.');
// Verify that images are not appended to the response. Currently this test only uses PNG images. // Verify that images are not appended to the response. Currently this test only uses PNG images.
if (strpos($generate_url, '.png') === FALSE ) { if (strpos($generate_url, '.png') === FALSE) {
$this->fail('Confirming that private image styles are not appended require PNG file.'); $this->fail('Confirming that private image styles are not appended require PNG file.');
} }
else { else {
......
...@@ -139,7 +139,7 @@ public function testInvalidUpload() { ...@@ -139,7 +139,7 @@ public function testInvalidUpload() {
foreach ($this->drupalGetTestFiles('image') as $image) { foreach ($this->drupalGetTestFiles('image') as $image) {
/** @var \Drupal\Core\Image\ImageInterface $image_file */ /** @var \Drupal\Core\Image\ImageInterface $image_file */
$image_file = $image_factory->get($image->uri); $image_file = $image_factory->get($image->uri);
if ($image_file->getWidth() < 50 || $image_file->getWidth() > 100 ) { if ($image_file->getWidth() < 50 || $image_file->getWidth() > 100) {
$invalid_image = $image; $invalid_image = $image;
break; break;
} }
......
...@@ -26,7 +26,7 @@ class NegotiationBrowserForm extends ConfigFormBase { ...@@ -26,7 +26,7 @@ class NegotiationBrowserForm extends ConfigFormBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function __construct(ConfigFactoryInterface $config_factory, ConfigurableLanguageManagerInterface $language_manager ) { public function __construct(ConfigFactoryInterface $config_factory, ConfigurableLanguageManagerInterface $language_manager) {
parent::__construct($config_factory); parent::__construct($config_factory);
$this->languageManager = $language_manager; $this->languageManager = $language_manager;
} }
......
...@@ -113,7 +113,7 @@ public function testUntranslatable() { ...@@ -113,7 +113,7 @@ public function testUntranslatable() {
$this->storage->getEntityType()->willReturn($entity_type->reveal()); $this->storage->getEntityType()->willReturn($entity_type->reveal());
$destination = new EntityTestDestination( $destination = new EntityTestDestination(
['translations' => TRUE ], ['translations' => TRUE],
'', '',
[], [],
$this->migration->reveal(), $this->migration->reveal(),
......
...@@ -138,7 +138,7 @@ public function checkAll(AccountInterface $account) { ...@@ -138,7 +138,7 @@ public function checkAll(AccountInterface $account) {
$grants = static::buildGrantsQueryCondition(node_access_grants('view', $account)); $grants = static::buildGrantsQueryCondition(node_access_grants('view', $account));
if (count($grants) > 0 ) { if (count($grants) > 0) {
$query->condition($grants); $query->condition($grants);
} }
return $query->execute()->fetchField(); return $query->execute()->fetchField();
......
...@@ -184,7 +184,7 @@ public function testNodeAddWithoutContentTypes() { ...@@ -184,7 +184,7 @@ public function testNodeAddWithoutContentTypes() {
$this->assertNoLinkByHref('/admin/structure/types/add'); $this->assertNoLinkByHref('/admin/structure/types/add');
// Test /node/add page without content types. // Test /node/add page without content types.
foreach (\Drupal::entityManager()->getStorage('node_type')->loadMultiple() as $entity ) { foreach (\Drupal::entityManager()->getStorage('node_type')->loadMultiple() as $entity) {
$entity->delete(); $entity->delete();
} }
......
...@@ -574,7 +574,7 @@ public function execute() { ...@@ -574,7 +574,7 @@ public function execute() {
// Add arguments for the keyword relevance normalization number. // Add arguments for the keyword relevance normalization number.
$normalization = 1.0 / $this->normalize; $normalization = 1.0 / $this->normalize;
for ($i = 0; $i < $this->relevance_count; $i++ ) { for ($i = 0; $i < $this->relevance_count; $i++) {
$this->scoresArguments[':normalization_' . $i] = $normalization; $this->scoresArguments[':normalization_' . $i] = $normalization;
} }
......
...@@ -175,7 +175,7 @@ public function stubTest() { ...@@ -175,7 +175,7 @@ public function stubTest() {
// along by the rethrow. // along by the rethrow.
assert(FALSE, 'Lorem Ipsum'); assert(FALSE, 'Lorem Ipsum');
} }
catch (\AssertionError $e ) { catch (\AssertionError $e) {
$this->assertEqual($e->getMessage(), 'Lorem Ipsum', 'Runtime assertions Enabled and running.'); $this->assertEqual($e->getMessage(), 'Lorem Ipsum', 'Runtime assertions Enabled and running.');
} }
} }
......
...@@ -45,7 +45,7 @@ protected function validateArguments(array $arguments) { ...@@ -45,7 +45,7 @@ protected function validateArguments(array $arguments) {
// Validate or set background color argument. // Validate or set background color argument.
if (!empty($arguments['background'])) { if (!empty($arguments['background'])) {
// Validate the background color: Color::hexToRgb does so for us. // Validate the background color: Color::hexToRgb does so for us.
$background = Color::hexToRgb($arguments['background']) + ['alpha' => 0 ]; $background = Color::hexToRgb($arguments['background']) + ['alpha' => 0];
} }
else { else {
// Background color is not specified: use transparent white as background. // Background color is not specified: use transparent white as background.
......
...@@ -275,7 +275,7 @@ protected function assertInstallModuleUpdates($module) { ...@@ -275,7 +275,7 @@ protected function assertInstallModuleUpdates($module) {
$all_update_functions = $post_update_registry->getPendingUpdateFunctions(); $all_update_functions = $post_update_registry->getPendingUpdateFunctions();
$empty_result = TRUE; $empty_result = TRUE;
foreach ($all_update_functions as $function) { foreach ($all_update_functions as $function) {
list($function_module, ) = explode('_post_update_', $function); list($function_module,) = explode('_post_update_', $function);
if ($module === $function_module) { if ($module === $function_module) {
$empty_result = FALSE; $empty_result = FALSE;
break; break;
......
...@@ -621,7 +621,7 @@ function system_requirements($phase) { ...@@ -621,7 +621,7 @@ function system_requirements($phase) {
} }
} }
} }
if ($phase != 'install' && (empty($GLOBALS['config_directories']) || empty($GLOBALS['config_directories'][CONFIG_SYNC_DIRECTORY]) )) { if ($phase != 'install' && (empty($GLOBALS['config_directories']) || empty($GLOBALS['config_directories'][CONFIG_SYNC_DIRECTORY]))) {
$requirements['config directories'] = [ $requirements['config directories'] = [
'title' => t('Configuration directories'), 'title' => t('Configuration directories'),
'value' => t('Not present'), 'value' => t('Not present'),
...@@ -1538,7 +1538,7 @@ function system_update_8007() { ...@@ -1538,7 +1538,7 @@ function system_update_8007() {
$schema = \Drupal::keyValue('entity.storage_schema.sql')->getAll(); $schema = \Drupal::keyValue('entity.storage_schema.sql')->getAll();
$schema_copy = $schema; $schema_copy = $schema;
foreach ($schema as $item_name => $item) { foreach ($schema as $item_name => $item) {
list($entity_type_id, , ) = explode('.', $item_name); list($entity_type_id, ,) = explode('.', $item_name);
if (!isset($entity_types[$entity_type_id])) { if (!isset($entity_types[$entity_type_id])) {
continue; continue;
} }
......
...@@ -611,7 +611,7 @@ function system_page_attachments(array &$page) { ...@@ -611,7 +611,7 @@ function system_page_attachments(array &$page) {
} }
// Get the major Drupal version. // Get the major Drupal version.
list($version, ) = explode('.', \Drupal::VERSION); list($version,) = explode('.', \Drupal::VERSION);
// Attach default meta tags. // Attach default meta tags.
$meta_default = [ $meta_default = [
......
...@@ -14,7 +14,7 @@ class AdminMetaTagTest extends BrowserTestBase { ...@@ -14,7 +14,7 @@ class AdminMetaTagTest extends BrowserTestBase {
* Verify that the meta tag HTML is generated correctly. * Verify that the meta tag HTML is generated correctly.
*/ */
public function testMetaTag() { public function testMetaTag() {
list($version, ) = explode('.', \Drupal::VERSION); list($version,) = explode('.', \Drupal::VERSION);
$string = '<meta name="Generator" content="Drupal ' . $version . ' (https://www.drupal.org)" />'; $string = '<meta name="Generator" content="Drupal ' . $version . ' (https://www.drupal.org)" />';
$this->drupalGet('node'); $this->drupalGet('node');
$this->assertRaw($string, 'Fingerprinting meta tag generated correctly.', 'System'); $this->assertRaw($string, 'Fingerprinting meta tag generated correctly.', 'System');
......
...@@ -65,7 +65,7 @@ public function testTermIndentation() { ...@@ -65,7 +65,7 @@ public function testTermIndentation() {
'terms[tid:' . $term2->id() . ':0][weight]' => 1, 'terms[tid:' . $term2->id() . ':0][weight]' => 1,
]; ];
$this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->get('vid' ) . '/overview', $edit, t('Save')); $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->get('vid') . '/overview', $edit, t('Save'));
// All terms back at the root level, no indentation should be present. // All terms back at the root level, no indentation should be present.
$this->assertNoPattern('|<div class="js-indentation indentation">&nbsp;</div>|'); $this->assertNoPattern('|<div class="js-indentation indentation">&nbsp;</div>|');
......
...@@ -18,7 +18,7 @@ class TermKernelTest extends KernelTestBase { ...@@ -18,7 +18,7 @@ class TermKernelTest extends KernelTestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static $modules = ['filter', 'taxonomy', 'text', 'user' ]; public static $modules = ['filter', 'taxonomy', 'text', 'user'];
/** /**
* {@inheritdoc} * {@inheritdoc}
......
...@@ -109,7 +109,7 @@ function hook_toolbar() { ...@@ -109,7 +109,7 @@ function hook_toolbar() {
'#heading' => t('Shopping cart actions'), '#heading' => t('Shopping cart actions'),
'shopping_cart' => [ 'shopping_cart' => [
'#theme' => 'item_list', '#theme' => 'item_list',
'#items' => [/* An item list renderable array */ ], '#items' => [/* An item list renderable array */],
], ],
], ],
'#weight' => 150, '#weight' => 150,
......
...@@ -345,7 +345,7 @@ function _toolbar_do_get_rendered_subtrees(array $data) { ...@@ -345,7 +345,7 @@ function _toolbar_do_get_rendered_subtrees(array $data) {
// Many routes have dots as route name, while some special ones like <front> // Many routes have dots as route name, while some special ones like <front>
// have <> characters in them. // have <> characters in them.
$url = $link->getUrlObject(); $url = $link->getUrlObject();
$id = str_replace(['.', '<', '>'], ['-', '', '' ], $url->isRouted() ? $url->getRouteName() : $url->getUri()); $id = str_replace(['.', '<', '>'], ['-', '', ''], $url->isRouted() ? $url->getRouteName() : $url->getUri());
$subtrees[$id] = $output; $subtrees[$id] = $output;
} }
......
...@@ -254,7 +254,7 @@ public function testRegistrationDefaultValues() { ...@@ -254,7 +254,7 @@ public function testRegistrationDefaultValues() {
$new_user = reset($accounts); $new_user = reset($accounts);
$this->assertEqual($new_user->getUsername(), $name, 'Username matches.'); $this->assertEqual($new_user->getUsername(), $name, 'Username matches.');
$this->assertEqual($new_user->getEmail(), $mail, 'Email address matches.'); $this->assertEqual($new_user->getEmail(), $mail, 'Email address matches.');
$this->assertTrue(($new_user->getCreatedTime() > REQUEST_TIME - 20 ), 'Correct creation time.'); $this->assertTrue(($new_user->getCreatedTime() > REQUEST_TIME - 20), 'Correct creation time.');
$this->assertEqual($new_user->isActive(), $config_user_settings->get('register') == USER_REGISTER_VISITORS ? 1 : 0, 'Correct status field.'); $this->assertEqual($new_user->isActive(), $config_user_settings->get('register') == USER_REGISTER_VISITORS ? 1 : 0, 'Correct status field.');
$this->assertEqual($new_user->getTimezone(), $config_system_date->get('timezone.default'), 'Correct time zone field.'); $this->assertEqual($new_user->getTimezone(), $config_system_date->get('timezone.default'), 'Correct time zone field.');
$this->assertEqual($new_user->langcode->value, \Drupal::languageManager()->getDefaultLanguage()->getId(), 'Correct language field.'); $this->assertEqual($new_user->langcode->value, \Drupal::languageManager()->getDefaultLanguage()->getId(), 'Correct language field.');
......
...@@ -24,7 +24,7 @@ class MonthDate extends Date { ...@@ -24,7 +24,7 @@ class MonthDate extends Date {
*/ */
public function summaryName($data) { public function summaryName($data) {
$month = str_pad($data->{$this->name_alias}, 2, '0', STR_PAD_LEFT); $month = str_pad($data->{$this->name_alias}, 2, '0', STR_PAD_LEFT);
return format_date(strtotime("2005" . $month . "15" . " 00:00:00 UTC" ), 'custom', $this->format, 'UTC'); return format_date(strtotime("2005" . $month . "15" . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
} }
/** /**
......
...@@ -865,10 +865,10 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ...@@ -865,10 +865,10 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$optgroup_arguments = (string) t('Arguments'); $optgroup_arguments = (string) t('Arguments');
$optgroup_fields = (string) t('Fields'); $optgroup_fields = (string) t('Fields');
foreach ($previous as $id => $label) { foreach ($previous as $id => $label) {
$options[$optgroup_fields]["{{ $id }}"] = substr(strrchr($label, ":"), 2 ); $options[$optgroup_fields]["{{ $id }}"] = substr(strrchr($label, ":"), 2);
} }
// Add the field to the list of options. // Add the field to the list of options.
$options[$optgroup_fields]["{{ {$this->options['id']} }}"] = substr(strrchr($this->adminLabel(), ":"), 2 ); $options[$optgroup_fields]["{{ {$this->options['id']} }}"] = substr(strrchr($this->adminLabel(), ":"), 2);
foreach ($this->view->display_handler->getHandlers('argument') as $arg => $handler) { foreach ($this->view->display_handler->getHandlers('argument') as $arg => $handler) {
$options[$optgroup_arguments]["{{ arguments.$arg }}"] = $this->t('@argument title', ['@argument' => $handler->adminLabel()]); $options[$optgroup_arguments]["{{ arguments.$arg }}"] = $this->t('@argument title', ['@argument' => $handler->adminLabel()]);
......
...@@ -37,7 +37,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ...@@ -37,7 +37,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state); parent::buildOptionsForm($form, $form_state);
// Expand the description of the 'Inline field' checkboxes. // Expand the description of the 'Inline field' checkboxes.
$form['inline']['#description'] .= '<br />' . $this->t("<strong>Note:</strong> In 'Entity Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here." ); $form['inline']['#description'] .= '<br />' . $this->t("<strong>Note:</strong> In 'Entity Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here.");
} }
/** /**
......
...@@ -47,7 +47,7 @@ protected function setUp($import_test_views = TRUE) { ...@@ -47,7 +47,7 @@ protected function setUp($import_test_views = TRUE) {
public function testEntityRow() { public function testEntityRow() {
$vocab = Vocabulary::create(['name' => $this->randomMachineName(), 'vid' => strtolower($this->randomMachineName())]); $vocab = Vocabulary::create(['name' => $this->randomMachineName(), 'vid' => strtolower($this->randomMachineName())]);
$vocab->save(); $vocab->save();
$term = Term::create(['name' => $this->randomMachineName(), 'vid' => $vocab->id() ]); $term = Term::create(['name' => $this->randomMachineName(), 'vid' => $vocab->id()]);
$term->save(); $term->save();
$view = Views::getView('test_entity_row'); $view = Views::getView('test_entity_row');
......
...@@ -265,7 +265,7 @@ public function save(array $form, FormStateInterface $form_state) { ...@@ -265,7 +265,7 @@ public function save(array $form, FormStateInterface $form_state) {
// options. // options.
$display_handler = $executable->displayHandlers->get($id); $display_handler = $executable->displayHandlers->get($id);
if ($attachments = $display_handler->getAttachedDisplays()) { if ($attachments = $display_handler->getAttachedDisplays()) {
foreach ($attachments as $attachment ) { foreach ($attachments as $attachment) {
$attached_options = $executable->displayHandlers->get($attachment)->getOption('displays'); $attached_options = $executable->displayHandlers->get($attachment)->getOption('displays');
unset($attached_options[$id]); unset($attached_options[$id]);
$executable->displayHandlers->get($attachment)->setOption('displays', $attached_options); $executable->displayHandlers->get($attachment)->setOption('displays', $attached_options);
......
...@@ -118,6 +118,7 @@ ...@@ -118,6 +118,7 @@
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/PregSecuritySniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/PregSecuritySniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookMenuSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookMenuSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookSchemaSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookSchemaSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/CloseBracketSpacingSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/CommaSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/CommaSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/EmptyLinesSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/EmptyLinesSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/NamespaceSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/NamespaceSniff.php"/>
......
...@@ -336,7 +336,7 @@ public function testSchemaData() { ...@@ -336,7 +336,7 @@ public function testSchemaData() {
$effect = $effects->get($uuid)->getElements(); $effect = $effects->get($uuid)->getElements();
$this->assertTrue(!$effect['data']->isEmpty() && $effect['id']->getValue() == 'image_scale', 'Got data for the image scale effect from metadata.'); $this->assertTrue(!$effect['data']->isEmpty() && $effect['id']->getValue() == 'image_scale', 'Got data for the image scale effect from metadata.');
$this->assertTrue($effect['data']->get('width') instanceof IntegerInterface, 'Got the right type for the scale effect width.'); $this->assertTrue($effect['data']->get('width') instanceof IntegerInterface, 'Got the right type for the scale effect width.');
$this->assertEqual($effect['data']->get('width')->getValue(), 480, 'Got the right value for the scale effect width.' ); $this->assertEqual($effect['data']->get('width')->getValue(), 480, 'Got the right value for the scale effect width.');
} }
/** /**
......
...@@ -131,7 +131,7 @@ public function testMultipleStatementsForNewPhp() { ...@@ -131,7 +131,7 @@ public function testMultipleStatementsForNewPhp() {
try { try {
$db->query('SELECT * FROM {test}; SELECT * FROM {test_people}', $db->query('SELECT * FROM {test}; SELECT * FROM {test_people}',
[], [],
['allow_delimiter_in_query' => TRUE ] ['allow_delimiter_in_query' => TRUE]
); );
$this->fail('No PDO exception thrown for multiple statements.'); $this->fail('No PDO exception thrown for multiple statements.');
} }
......
...@@ -87,12 +87,12 @@ public function providerTestMerge() { ...@@ -87,12 +87,12 @@ public function providerTestMerge() {
public function testAddCacheTags() { public function testAddCacheTags() {
$metadata = new CacheableMetadata(); $metadata = new CacheableMetadata();
$add_expected = [ $add_expected = [
[[], [] ], [[], []],
[['foo:bar'], ['foo:bar'] ], [['foo:bar'], ['foo:bar']],
[['foo:baz'], ['foo:bar', 'foo:baz'] ], [['foo:baz'], ['foo:bar', 'foo:baz']],
[['axx:first', 'foo:baz'], ['axx:first', 'foo:bar', 'foo:baz'] ], [['axx:first', 'foo:baz'], ['axx:first', 'foo:bar', 'foo:baz']],
[[], ['axx:first', 'foo:bar', 'foo:baz'] ], [[], ['axx:first', 'foo:bar', 'foo:baz']],
[['axx:first'], ['axx:first', 'foo:bar', 'foo:baz'] ], [['axx:first'], ['axx:first', 'foo:bar', 'foo:baz']],
]; ];
foreach ($add_expected as $data) { foreach ($add_expected as $data) {
......
...@@ -320,7 +320,7 @@ public function testGetWithoutData() { ...@@ -320,7 +320,7 @@ public function testGetWithoutData() {
* @covers ::set * @covers ::set
*/ */
public function testSet() { public function testSet() {
$id_items = [['value' => $this->id + 1] ]; $id_items = [['value' => $this->id + 1]];
$this->fieldItemList->expects($this->once()) $this->fieldItemList->expects($this->once())
->method('setValue') ->method('setValue')
...@@ -334,7 +334,7 @@ public function testSet() { ...@@ -334,7 +334,7 @@ public function testSet() {
*/ */
public function testSetWithoutData() { public function testSetWithoutData() {
$this->entityAdapter->setValue(NULL); $this->entityAdapter->setValue(NULL);
$id_items = [['value' => $this->id + 1] ]; $id_items = [['value' => $this->id + 1]];
$this->setExpectedException(MissingDataException::class); $this->setExpectedException(MissingDataException::class);
$this->entityAdapter->set('id', $id_items); $this->entityAdapter->set('id', $id_items);
} }
...@@ -397,7 +397,7 @@ public function testGetDataDefinition() { ...@@ -397,7 +397,7 @@ public function testGetDataDefinition() {
$definition = $this->entityAdapter->getDataDefinition(); $definition = $this->entityAdapter->getDataDefinition();
$this->assertInstanceOf('\Drupal\Core\Entity\TypedData\EntityDataDefinitionInterface', $definition); $this->assertInstanceOf('\Drupal\Core\Entity\TypedData\EntityDataDefinitionInterface', $definition);
$this->assertEquals($definition->getEntityTypeId(), $this->entityTypeId); $this->assertEquals($definition->getEntityTypeId(), $this->entityTypeId);
$this->assertEquals($definition->getBundles(), [$this->bundle ]); $this->assertEquals($definition->getBundles(), [$this->bundle]);
} }
/** /**
......
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