Commit 2c03b9f0 authored by alexpott's avatar alexpott
Browse files

Issue #2572789 by attiks, andriyun: Fix 'Drupal.WhiteSpace.Comma' coding standard

parent a2f20694
......@@ -1782,7 +1782,7 @@ function drupal_common_theme() {
'render element' => 'page',
),
'maintenance_task_list' => array(
'variables' => array('items' => NULL, 'active' => NULL, 'variant' => NULL),
'variables' => array('items' => NULL, 'active' => NULL, 'variant' => NULL),
),
'authorize_report' => array(
'variables' => ['messages' => [], 'attributes' => []],
......
......@@ -14,7 +14,7 @@
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
class CacheFactory implements CacheFactoryInterface, ContainerAwareInterface {
class CacheFactory implements CacheFactoryInterface, ContainerAwareInterface {
use ContainerAwareTrait;
......
......@@ -61,7 +61,7 @@ public static function create($string) {
* A list of allowed tags.
*/
public static function allowedTags() {
return ['a', 'b', 'big', 'code', 'del', 'em', 'i', 'ins', 'pre', 'q', 'small', 'span', 'strong', 'sub', 'sup', 'tt', 'ol', 'ul', 'li', 'p', 'br', 'img'];
return ['a', 'b', 'big', 'code', 'del', 'em', 'i', 'ins', 'pre', 'q', 'small', 'span', 'strong', 'sub', 'sup', 'tt', 'ol', 'ul', 'li', 'p', 'br', 'img'];
}
/**
......
......@@ -30,7 +30,7 @@ public function connect() {
* {@inheritdoc}
*/
protected function copyFileJailed($source, $destination) {
if (!@ftp_put($this->connection, $destination, $source, FTP_BINARY)) {
if (!@ftp_put($this->connection, $destination, $source, FTP_BINARY)) {
throw new FileTransferException("Cannot move @source to @destination", NULL, array("@source" => $source, "@destination" => $destination));
}
}
......
......@@ -267,7 +267,7 @@ public function getActiveTheme(Extension $theme, array $base_themes = []) {
*/
protected function getExtensions() {
if (!isset($this->extensions)) {
$this->extensions = array_merge($this->moduleHandler->getModuleList(), $this->themeHandler->listInfo());
$this->extensions = array_merge($this->moduleHandler->getModuleList(), $this->themeHandler->listInfo());
}
return $this->extensions;
}
......
......@@ -260,7 +260,7 @@ public function getDefaultConstraints(DataDefinitionInterface $definition) {
$constraints['NotNull'] = array();
}
// Check if the class provides allowed values.
if (is_subclass_of($definition->getClass(),'Drupal\Core\TypedData\OptionsProviderInterface')) {
if (is_subclass_of($definition->getClass(), 'Drupal\Core\TypedData\OptionsProviderInterface')) {
$constraints['AllowedValues'] = array();
}
return $constraints;
......
......@@ -52,7 +52,7 @@ public static function decodeException($exception) {
// The first element in the stack is the call, the second element gives us
// the caller. We skip calls that occurred in one of the classes of the
// database layer or in one of its global functions.
$db_functions = array('db_query', 'db_query_range');
$db_functions = array('db_query', 'db_query_range');
while (!empty($backtrace[1]) && ($caller = $backtrace[1]) &&
((isset($caller['class']) && (strpos($caller['class'], 'Query') !== FALSE || strpos($caller['class'], 'Database') !== FALSE || strpos($caller['class'], 'PDO') !== FALSE)) ||
in_array($caller['function'], $db_functions))) {
......
......@@ -265,7 +265,7 @@ public function testBlockRendering() {
$result = $this->xpath('//div[contains(@class, "region-sidebar-first")]/div[contains(@class, "block-views")]/h2');
$this->assertTrue(empty($result), 'The title is not visible.');
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:system.site', 'config:views.view.test_view_block' ,'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:system.site', 'config:views.view.test_view_block' , 'rendered']));
}
/**
......@@ -291,7 +291,7 @@ public function testBlockEmptyRendering() {
$this->assertEqual(0, count($this->xpath('//div[contains(@class, "block-views-blocktest-view-block-block-1")]')));
// Ensure that the view cachability metadata is propagated even, for an
// empty block.
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' ,'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'rendered']));
$this->assertCacheContexts(['url.query_args:_wrapper_format']);
// Add a header displayed on empty result.
......@@ -309,7 +309,7 @@ public function testBlockEmptyRendering() {
$this->drupalGet($url);
$this->assertEqual(1, count($this->xpath('//div[contains(@class, "block-views-blocktest-view-block-block-1")]')));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' ,'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'rendered']));
$this->assertCacheContexts(['url.query_args:_wrapper_format']);
// Hide the header on empty results.
......@@ -327,7 +327,7 @@ public function testBlockEmptyRendering() {
$this->drupalGet($url);
$this->assertEqual(0, count($this->xpath('//div[contains(@class, "block-views-blocktest-view-block-block-1")]')));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' ,'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'rendered']));
$this->assertCacheContexts(['url.query_args:_wrapper_format']);
// Add an empty text.
......@@ -344,7 +344,7 @@ public function testBlockEmptyRendering() {
$this->drupalGet($url);
$this->assertEqual(1, count($this->xpath('//div[contains(@class, "block-views-blocktest-view-block-block-1")]')));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' ,'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'rendered']));
$this->assertCacheContexts(['url.query_args:_wrapper_format']);
}
......
......@@ -24,7 +24,7 @@ class RevisionRelationshipsTest extends ViewTestBase {
*
* @var array
*/
public static $modules = array('block_content' ,'block_content_test_views');
public static $modules = array('block_content' , 'block_content_test_views');
/**
* Views used by this test.
......
......@@ -129,7 +129,7 @@ public function testCommentPreviewDuplicateSubmission() {
* Tests comment edit, preview, and save.
*/
function testCommentEditPreviewSave() {
$web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'skip comment approval', 'edit own comments'));
$web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'skip comment approval', 'edit own comments'));
$this->drupalLogin($this->adminUser);
$this->setCommentPreview(DRUPAL_OPTIONAL);
$this->setCommentForm(TRUE);
......
......@@ -47,7 +47,7 @@ public function testLinkApprove() {
$view = Views::getView('test_comment');
$view->setDisplay();
$view->displayHandlers->get('default')->overrideOption('fields', [
$view->displayHandlers->get('default')->overrideOption('fields', [
'approve_comment' => [
'table' => 'comment',
'field' => 'approve_comment',
......@@ -134,7 +134,7 @@ public function testLinkReply() {
$view = Views::getView('test_comment');
$view->setDisplay();
$view->displayHandlers->get('default')->overrideOption('fields', [
$view->displayHandlers->get('default')->overrideOption('fields', [
'replyto_comment' => [
'table' => 'comment',
'field' => 'replyto_comment',
......
......@@ -92,7 +92,7 @@ function testDiff() {
$diff = \Drupal::service('config.manager')->diff($active, $sync, $config_name, $config_name);
// Prove the fields match.
$edits = $diff->getEdits();
$this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
$this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
$this->assertEqual(count($edits), 1, 'There is one item in the diff');
// Rename the entity.
......@@ -102,11 +102,11 @@ function testDiff() {
$diff = \Drupal::service('config.manager')->diff($active, $sync, 'config_test.dynamic.' . $new_test_entity_id, $config_name);
$edits = $diff->getEdits();
$this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
$this->assertEqual($edits[1]->type, 'change', 'The second item in the diff is a change.');
$this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
$this->assertEqual($edits[1]->type, 'change', 'The second item in the diff is a change.');
$this->assertEqual($edits[1]->orig, array('id: ' . $new_test_entity_id));
$this->assertEqual($edits[1]->closing, array('id: ' . $test_entity_id));
$this->assertEqual($edits[2]->type, 'copy', 'The third item in the diff is a copy.');
$this->assertEqual($edits[2]->type, 'copy', 'The third item in the diff is a copy.');
$this->assertEqual(count($edits), 3, 'There are three items in the diff.');
}
......@@ -132,16 +132,16 @@ function testCollectionDiff() {
// Test the fields match in the default collection diff.
$diff = \Drupal::service('config.manager')->diff($active, $sync, $config_name);
$edits = $diff->getEdits();
$this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
$this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
$this->assertEqual(count($edits), 1, 'There is one item in the diff');
// Test that the differences are detected when diffing the collection.
$diff = \Drupal::service('config.manager')->diff($active, $sync, $config_name, NULL, 'test');
$edits = $diff->getEdits();
$this->assertEqual($edits[0]->type, 'change', 'The second item in the diff is a copy.');
$this->assertEqual($edits[0]->type, 'change', 'The second item in the diff is a copy.');
$this->assertEqual($edits[0]->orig, array('foo: bar'));
$this->assertEqual($edits[0]->closing, array('foo: baz'));
$this->assertEqual($edits[1]->type, 'copy', 'The second item in the diff is a copy.');
$this->assertEqual($edits[1]->type, 'copy', 'The second item in the diff is a copy.');
}
}
......@@ -87,7 +87,7 @@ function testInstallProfileConfigOverwrite() {
// type does not exist.
$optional_dir = drupal_get_path('module', 'testing_config_overrides') . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY;
$optional_storage = new FileStorage($optional_dir);
foreach (['config_test.dynamic.dotted.default', 'config_test.dynamic.override','config_test.dynamic.override_unmet'] as $id) {
foreach (['config_test.dynamic.dotted.default', 'config_test.dynamic.override', 'config_test.dynamic.override_unmet'] as $id) {
$this->assertTrue(\Drupal::config($id)->isNew(), "The config_test entity $id contained in the profile's optional directory does not exist.");
// Make that we don't get false positives from the assertion above.
$this->assertTrue($optional_storage->exists($id), "The config_test entity $id does exist in the profile's optional directory.");
......
......@@ -22,7 +22,7 @@ class ConfigLanguageOverrideTest extends KernelTestBase {
*
* @var array
*/
public static $modules = array('user', 'language', 'config_test', 'system', 'field');
public static $modules = array('user', 'language', 'config_test', 'system', 'field');
/**
* {@inheritdoc}
......
......@@ -30,7 +30,7 @@ class ContactCategoryTest extends MigrateSqlSourceTestCase {
array(
'cid' => 1,
'category' => 'contact category value 1',
'recipients' => array('admin@example.com','user@example.com'),
'recipients' => array('admin@example.com', 'user@example.com'),
'reply' => 'auto reply value 1',
'weight' => 0,
'selected' => 0,
......@@ -38,7 +38,7 @@ class ContactCategoryTest extends MigrateSqlSourceTestCase {
array(
'cid' => 2,
'category' => 'contact category value 2',
'recipients' => array('admin@example.com','user@example.com'),
'recipients' => array('admin@example.com', 'user@example.com'),
'reply' => 'auto reply value 2',
'weight' => 0,
'selected' => 0,
......
......@@ -78,7 +78,7 @@ function hook_field_storage_config_update_forbid(\Drupal\field\FieldStorageConfi
// Forbid any update that removes allowed values with actual data.
$allowed_values = $field_storage->getSetting('allowed_values');
$prior_allowed_values = $prior_field_storage->getSetting('allowed_values');
$lost_keys = array_keys(array_diff_key($prior_allowed_values,$allowed_values));
$lost_keys = array_keys(array_diff_key($prior_allowed_values, $allowed_values));
if (_options_values_in_use($field_storage->getTargetEntityTypeId(), $field_storage->getName(), $lost_keys)) {
throw new \Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException(t('A list field (@field_name) with existing data cannot have its keys changed.', array('@field_name' => $field_storage->getName())));
}
......
......@@ -34,7 +34,7 @@ public function query() {
'type',
'module',
))
->condition('fci.entity_type','node');
->condition('fci.entity_type', 'node');
$query->join('field_config', 'fc', 'fci.field_id = fc.id');
return $query;
}
......
......@@ -62,7 +62,7 @@ protected function setUp() {
$this->installEntitySchema('entity_test_mul');
// Create reference from entity_test to entity_test_mul.
$this->createEntityReferenceField('entity_test','entity_test','field_test_data','field_test_data','entity_test_mul');
$this->createEntityReferenceField('entity_test', 'entity_test', 'field_test_data', 'field_test_data', 'entity_test_mul');
// Create reference from entity_test_mul to entity_test.
$this->createEntityReferenceField('entity_test_mul', 'entity_test_mul', 'field_data_test', 'field_data_test', 'entity_test');
......
......@@ -80,8 +80,8 @@ public function testEntityCountAndHasData() {
// Create 12 entities to ensure that the purging works as expected.
for ($i=0; $i < 12; $i++) {
$entity = entity_create('entity_test');
$entity->field_int[] = mt_rand(1,99);
$entity->field_int[] = mt_rand(1,99);
$entity->field_int[] = mt_rand(1, 99);
$entity->field_int[] = mt_rand(1, 99);
$entity->name[] = $this->randomMachineName();
$entity->save();
}
......
......@@ -39,22 +39,22 @@ public function testFields() {
// Integer field.
$field_storage = FieldStorageConfig::load('node.field_test_two');
$this->assertIdentical("integer", $field_storage->getType(), t('Field type is @fieldtype. It should be integer.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("integer", $field_storage->getType(), t('Field type is @fieldtype. It should be integer.', array('@fieldtype' => $field_storage->getType())));
// Float field.
$field_storage = FieldStorageConfig::load('node.field_test_three');
$this->assertIdentical("decimal", $field_storage->getType(), t('Field type is @fieldtype. It should be decimal.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("decimal", $field_storage->getType(), t('Field type is @fieldtype. It should be decimal.', array('@fieldtype' => $field_storage->getType())));
// Link field.
$field_storage = FieldStorageConfig::load('node.field_test_link');
$this->assertIdentical("link", $field_storage->getType(), t('Field type is @fieldtype. It should be link.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("link", $field_storage->getType(), t('Field type is @fieldtype. It should be link.', array('@fieldtype' => $field_storage->getType())));
// File field.
$field_storage = FieldStorageConfig::load('node.field_test_filefield');
$this->assertIdentical("file", $field_storage->getType(), t('Field type is @fieldtype. It should be file.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("file", $field_storage->getType(), t('Field type is @fieldtype. It should be file.', array('@fieldtype' => $field_storage->getType())));
$field_storage = FieldStorageConfig::load('node.field_test_imagefield');
$this->assertIdentical("image", $field_storage->getType(), t('Field type is @fieldtype. It should be image.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("image", $field_storage->getType(), t('Field type is @fieldtype. It should be image.', array('@fieldtype' => $field_storage->getType())));
$settings = $field_storage->getSettings();
$this->assertIdentical('file', $settings['target_type']);
$this->assertIdentical('public', $settings['uri_scheme']);
......@@ -62,15 +62,15 @@ public function testFields() {
// Phone field.
$field_storage = FieldStorageConfig::load('node.field_test_phone');
$this->assertIdentical("telephone", $field_storage->getType(), t('Field type is @fieldtype. It should be telephone.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("telephone", $field_storage->getType(), t('Field type is @fieldtype. It should be telephone.', array('@fieldtype' => $field_storage->getType())));
// Date field.
$field_storage = FieldStorageConfig::load('node.field_test_datetime');
$this->assertIdentical("datetime", $field_storage->getType(), t('Field type is @fieldtype. It should be datetime.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("datetime", $field_storage->getType(), t('Field type is @fieldtype. It should be datetime.', array('@fieldtype' => $field_storage->getType())));
// Decimal field with radio buttons.
$field_storage = FieldStorageConfig::load('node.field_test_decimal_radio_buttons');
$this->assertIdentical("list_float", $field_storage->getType(), t('Field type is @fieldtype. It should be list_float.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("list_float", $field_storage->getType(), t('Field type is @fieldtype. It should be list_float.', array('@fieldtype' => $field_storage->getType())));
$this->assertNotNull($field_storage->getSetting('allowed_values')['1.2'], t('First allowed value key is set to 1.2'));
$this->assertNotNull($field_storage->getSetting('allowed_values')['2.1'], t('Second allowed value key is set to 2.1'));
$this->assertIdentical('1.2', $field_storage->getSetting('allowed_values')['1.2'], t('First allowed value is set to 1.2'));
......@@ -78,11 +78,11 @@ public function testFields() {
// Float field with a single checkbox.
$field_storage = FieldStorageConfig::load('node.field_test_float_single_checkbox');
$this->assertIdentical("boolean", $field_storage->getType(), t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("boolean", $field_storage->getType(), t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->getType())));
// Integer field with a select list.
$field_storage = FieldStorageConfig::load('node.field_test_integer_selectlist');
$this->assertIdentical("list_integer", $field_storage->getType(), t('Field type is @fieldtype. It should be list_integer.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("list_integer", $field_storage->getType(), t('Field type is @fieldtype. It should be list_integer.', array('@fieldtype' => $field_storage->getType())));
$this->assertNotNull($field_storage->getSetting('allowed_values')['1234'], t('First allowed value key is set to 1234'));
$this->assertNotNull($field_storage->getSetting('allowed_values')['2341'], t('Second allowed value key is set to 2341'));
$this->assertNotNull($field_storage->getSetting('allowed_values')['3412'], t('Third allowed value key is set to 3412'));
......@@ -94,7 +94,7 @@ public function testFields() {
// Text field with a single checkbox.
$field_storage = FieldStorageConfig::load('node.field_test_text_single_checkbox');
$this->assertIdentical("boolean", $field_storage->getType(), t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->getType())));
$this->assertIdentical("boolean", $field_storage->getType(), t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->getType())));
// Validate that the source count and processed count match up.
/** @var \Drupal\migrate\Entity\MigrationInterface $migration */
......
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