Commit 6098437e authored by alexpott's avatar alexpott

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

parent 5c386edc
......@@ -181,7 +181,7 @@ protected function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) {
}
}
$this->lcs = 0;
$this->seq[0]= $yoff - 1;
$this->seq[0] = $yoff - 1;
$this->in_seq = array();
$ymids[0] = array();
......@@ -190,11 +190,11 @@ protected function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) {
for ($chunk = 0; $chunk < $nchunks; $chunk++) {
if ($chunk > 0) {
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++) {
$line = $flip ? $this->yv[$x] : $this->xv[$x];
if (empty($ymatches[$line])) {
......@@ -206,12 +206,12 @@ protected function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) {
if (empty($this->in_seq[$y])) {
$k = $this->_lcs_pos($y);
$this::USE_ASSERTS && assert($k > 0);
$ymids[$k] = $ymids[$k-1];
$ymids[$k] = $ymids[$k - 1];
break;
}
}
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]);
// Optimization: this is a common case:
// next match is just replacing previous match.
......@@ -222,7 +222,7 @@ protected function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) {
elseif (empty($this->in_seq[$y])) {
$k = $this->_lcs_pos($y);
$this::USE_ASSERTS && assert($k > 0);
$ymids[$k] = $ymids[$k-1];
$ymids[$k] = $ymids[$k - 1];
}
}
}
......
......@@ -139,7 +139,7 @@ public function name($length = 8, $unique = FALSE) {
* @return string
*/
public function word($length) {
mt_srand((double) microtime()*1000000);
mt_srand((double) microtime() * 1000000);
$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",
......
......@@ -83,7 +83,7 @@ public static function allowedIf($condition) {
* will be TRUE.
*/
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()) {
*/
public function listContents() {
$files = array();
for ($i=0; $i < $this->zip->numFiles; $i++) {
for ($i = 0; $i < $this->zip->numFiles; $i++) {
$files[] = $this->zip->getNameIndex($i);
}
return $files;
......
......@@ -234,12 +234,12 @@ public function formatDiff($from, $to, $options = array()) {
switch ($value) {
case 'y':
$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;
case 'm':
$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;
case 'd':
......@@ -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']));
$days -= $weeks * 7;
$granularity--;
$max_age = min($max_age, 7*86400);
$max_age = min($max_age, 7 * 86400);
}
if ((!$output || $weeks > 0) && $granularity > 0 && $days > 0) {
......
......@@ -88,7 +88,7 @@ public static function valueCallback(&$element, $input, FormStateInterface $form
break;
case 'hour':
$format = in_array('ampm', $element['#date_part_order']) ? 'g': 'G';
$format = in_array('ampm', $element['#date_part_order']) ? 'g' : 'G';
break;
case 'minute':
......@@ -218,7 +218,7 @@ public static function processDatelist(&$element, FormStateInterface $form_state
break;
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']);
$title = t('Hour');
break;
......
......@@ -50,7 +50,7 @@ public function process(ContainerBuilder $container) {
$root_namespace_dir = $namespaces[$root_namespace];
}
$message =<<<EOF
$message = <<<EOF
Missing proxy class '$proxy_class' for lazy service '$service_id'.
Use the following command to generate the proxy class:
......
......@@ -305,7 +305,7 @@ protected function initializePager() {
*/
public function tableSort(&$headers) {
// 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'])) {
$headers[$key]['field'] = '';
}
......
......@@ -212,7 +212,7 @@ public function addField($field, $type, $langcode) {
$entity_type = $this->entityManager->getDefinition($entity_type_id);
$field_storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id);
// 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);
$propertyDefinitions = array();
$key++;
......
......@@ -1174,7 +1174,7 @@ protected function saveToDedicatedTables(ContentEntityInterface $entity, $update
$vid = $id;
}
$original = !empty($entity->original) ? $entity->original: NULL;
$original = !empty($entity->original) ? $entity->original : NULL;
// Determine which fields should be actually stored.
$definitions = $this->entityManager->getFieldDefinitions($entity_type, $bundle);
......
......@@ -1032,7 +1032,7 @@ public function doBuildForm($form_id, &$element, FormStateInterface &$form_state
// Assign a decimal placeholder weight to preserve original array order.
if (!isset($element[$key]['#weight'])) {
$element[$key]['#weight'] = $count/1000;
$element[$key]['#weight'] = $count / 1000;
}
else {
// If one of the child elements has a weight then we will need to sort
......
......@@ -131,7 +131,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
// distract from the message that the Drupal installation has completed
// successfully.)
$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');
}
......
......@@ -76,11 +76,11 @@ public function stream_open($uri, $mode, $options, &$opened_path) {
*/
public function stream_lock($operation) {
// 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);
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);
}
......
......@@ -111,11 +111,11 @@ public function stream_open($uri, $mode, $options, &$opened_path) {
* @see http://php.net/manual/streamwrapper.stream-lock.php
*/
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);
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);
}
......
......@@ -75,7 +75,7 @@ public function testStringFormatter() {
$this->assertNotContains($aggregator_feed->getUrl(), $result);
// Verify aggregator item title with and without links.
$build = $aggregator_item->{$this->fieldName}->view(['type' => 'aggregator_title', 'settings' => ['display_as_link' =>TRUE]]);
$build = $aggregator_item->{$this->fieldName}->view(['type' => 'aggregator_title', 'settings' => ['display_as_link' => TRUE]]);
$result = $this->render($build);
$this->assertContains('test title', $result);
......
......@@ -86,7 +86,7 @@ public function providerGetEnabledButtons() {
* @dataProvider providerGetEnabledButtons
*/
public function testGetEnabledButtons(array $toolbar_rows, array $expected_buttons) {
$editor= $this->prophesize(Editor::class);
$editor = $this->prophesize(Editor::class);
$editor->getSettings()
->willReturn(['toolbar' => ['rows' => $toolbar_rows]]);
......
......@@ -780,7 +780,7 @@ function _color_hsl2rgb($hsl) {
$h = $hsl[0];
$s = $hsl[1];
$l = $hsl[2];
$m2 = ($l <= 0.5) ? $l * ($s + 1) : $l + $s - $l*$s;
$m2 = ($l <= 0.5) ? $l * ($s + 1) : $l + $s - $l * $s;
$m1 = $l * 2 - $m2;
return array(
......
......@@ -162,7 +162,7 @@ public function form(array $form, FormStateInterface $form_state) {
'#maxlength' => 60,
'#access' => $this->currentUser->isAnonymous() || $is_admin,
'#size' => 30,
'#attributes'=> [
'#attributes' => [
'data-drupal-default-value' => $config->get('anonymous'),
],
);
......
......@@ -25,7 +25,7 @@
))
->values(array(
'category' => 'Upgrade test',
'recipients'=> 'test1@example.com,test2@example.com',
'recipients' => 'test1@example.com,test2@example.com',
'reply' => 'Test reply',
'weight' => 1,
'selected' => 1,
......
......@@ -364,7 +364,7 @@ protected function getAuthenticatedMockMessage($copy_sender = FALSE) {
$message->expects($this->once())
->method('copySender')
->willReturn($copy_sender);
$recipient =$this->getMock('\Drupal\user\UserInterface');
$recipient = $this->getMock('\Drupal\user\UserInterface');
$recipient->expects($this->once())
->method('getEmail')
->willReturn('user2@drupal.org');
......
......@@ -46,7 +46,7 @@ function _contextual_links_id_testcases() {
$tests[] = array(
'links' => array(
'foo' => array(
'route_parameters'=> array(
'route_parameters' => array(
'bar',
'key' => 'baz',
'qux',
......
......@@ -36,7 +36,7 @@ function datetime_help($route_name, RouteMatchInterface $route_match) {
$output .= '<dt>' . t('Managing and displaying date fields') . '</dt>';
$output .= '<dd>' . t('The <em>settings</em> and the <em>display</em> of the Date field can be configured separately. See the <a href=":field_ui">Field UI help</a> for more information on how to manage fields and their display.', array(':field_ui' => (\Drupal::moduleHandler()->moduleExists('field_ui')) ? \Drupal::url('help.page', array('name' => 'field_ui')) : '#')) . '</dd>';
$output .= '<dt>' . t('Displaying dates') . '</dt>';
$output .= '<dd>' . t('Dates can be displayed using the <em>Plain</em> or the <em>Default</em> formatter. The <em>Plain</em> formatter displays the date in the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format. If you choose the <em>Default</em> formatter, you can choose a format from a predefined list that can be managed on the <a href=":date_format_list">Date and time formats</a> page.', array(':date_format_list'=> \Drupal::url('entity.date_format.collection'))) . '</dd>';
$output .= '<dd>' . t('Dates can be displayed using the <em>Plain</em> or the <em>Default</em> formatter. The <em>Plain</em> formatter displays the date in the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format. If you choose the <em>Default</em> formatter, you can choose a format from a predefined list that can be managed on the <a href=":date_format_list">Date and time formats</a> page.', array(':date_format_list' => \Drupal::url('entity.date_format.collection'))) . '</dd>';
$output .= '</dl>';
return $output;
}
......
......@@ -95,7 +95,7 @@ public static function processDefaultValue($default_value, FieldableEntityInterf
// A default value should be in the format and timezone used for date
// storage.
$date = new DrupalDateTime($default_value[0]['default_date'], DATETIME_STORAGE_TIMEZONE);
$storage_format = $definition->getSetting('datetime_type') == DateTimeItem::DATETIME_TYPE_DATE ? DATETIME_DATE_STORAGE_FORMAT: DATETIME_DATETIME_STORAGE_FORMAT;
$storage_format = $definition->getSetting('datetime_type') == DateTimeItem::DATETIME_TYPE_DATE ? DATETIME_DATE_STORAGE_FORMAT : DATETIME_DATETIME_STORAGE_FORMAT;
$value = $date->format($storage_format);
// We only provide a default value for the first item, as do all fields.
// Otherwise, there is no way to clear out unwanted values on multiple value
......
......@@ -106,7 +106,7 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin
// Just pick a date in the past year. No guidance is provided by this Field
// type.
$timestamp = REQUEST_TIME - mt_rand(0, 86400*365);
$timestamp = REQUEST_TIME - mt_rand(0, 86400 * 365);
if ($type == DateTimeItem::DATETIME_TYPE_DATE) {
$values['value'] = gmdate(DATETIME_DATE_STORAGE_FORMAT, $timestamp);
}
......
......@@ -76,7 +76,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
$element['value'] = array(
'#type' => 'datelist',
'#date_increment' => $increment,
'#date_part_order'=> $date_part_order,
'#date_part_order' => $date_part_order,
) + $element['value'];
return $element;
......
......@@ -77,7 +77,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
}
$element['value'] += array(
'#date_date_format'=> $date_format,
'#date_date_format' => $date_format,
'#date_date_element' => $date_type,
'#date_date_callbacks' => array(),
'#date_time_format' => $time_format,
......
......@@ -363,7 +363,7 @@ function testEntityDeleteBundle() {
// Verify no data gets loaded
$controller = $this->container->get('entity.manager')->getStorage($entity->getEntityTypeId());
$controller->resetCache();
$entity= $controller->load($entity->id());
$entity = $controller->load($entity->id());
$this->assertTrue(empty($entity->{$this->fieldTestData->field_name}), 'No data for first field');
$this->assertTrue(empty($entity->{$field_name}), 'No data for second field');
......
......@@ -74,7 +74,7 @@ public function testEntityCountAndHasData() {
$this->assertIdentical($this->storage->countFieldData($field_storage), 0, 'There are 0 entities with field data.');
// Create 12 entities to ensure that the purging works as expected.
for ($i=0; $i < 12; $i++) {
for ($i = 0; $i < 12; $i++) {
$entity = EntityTest::create();
$entity->field_int[] = mt_rand(1, 99);
$entity->field_int[] = mt_rand(1, 99);
......
......@@ -125,7 +125,7 @@ public function testImportAlreadyDeletedUninstall() {
])->save();
// Create 12 entities to ensure that the purging works as expected.
for ($i=0; $i < 12; $i++) {
for ($i = 0; $i < 12; $i++) {
$entity = EntityTest::create();
$value = '+0123456789';
$entity->field_test = $value;
......
......@@ -140,7 +140,7 @@ public function testCalculateDependencies() {
$this->fieldTypePluginManager->expects($this->any())
->method('getDefinition')
->with('test_field')
->willReturn(['provider' => 'test_module', 'config_dependencies' =>['module' => ['test_module2']], 'class' => '\Drupal\Tests\field\Unit\DependencyFieldItem']);
->willReturn(['provider' => 'test_module', 'config_dependencies' => ['module' => ['test_module2']], 'class' => '\Drupal\Tests\field\Unit\DependencyFieldItem']);
$this->fieldStorage->expects($this->once())
->method('getConfigDependencyName')
......@@ -201,7 +201,7 @@ public function testCalculateDependenciesIncorrectBundle() {
$this->fieldTypePluginManager->expects($this->any())
->method('getDefinition')
->with('test_field')
->willReturn(['provider' => 'test_module', 'config_dependencies' =>['module' => ['test_module2']], 'class' => '\Drupal\Tests\field\Unit\DependencyFieldItem']);
->willReturn(['provider' => 'test_module', 'config_dependencies' => ['module' => ['test_module2']], 'class' => '\Drupal\Tests\field\Unit\DependencyFieldItem']);
$field = new FieldConfig(array(
'field_name' => $this->fieldStorage->getName(),
......
......@@ -30,7 +30,7 @@ function file_help($route_name, RouteMatchInterface $route_match) {
case 'help.page.file':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The File module allows you to create fields that contain files. See the <a href=":field">Field module help</a> and the <a href=":field_ui">Field UI help</a> pages for general information on fields and how to create and manage them. For more information, see the <a href=":file_documentation">online documentation for the File module</a>.', array(':field' => \Drupal::url('help.page', array('name' => 'field')), ':field_ui' => (\Drupal::moduleHandler()->moduleExists('field_ui')) ? \Drupal::url('help.page', array('name' => 'field_ui')) :'#', ':file_documentation' => 'https://www.drupal.org/documentation/modules/file')) . '</p>';
$output .= '<p>' . t('The File module allows you to create fields that contain files. See the <a href=":field">Field module help</a> and the <a href=":field_ui">Field UI help</a> pages for general information on fields and how to create and manage them. For more information, see the <a href=":file_documentation">online documentation for the File module</a>.', array(':field' => \Drupal::url('help.page', array('name' => 'field')), ':field_ui' => (\Drupal::moduleHandler()->moduleExists('field_ui')) ? \Drupal::url('help.page', array('name' => 'field_ui')) : '#', ':file_documentation' => 'https://www.drupal.org/documentation/modules/file')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Managing and displaying file fields') . '</dt>';
......
......@@ -22,7 +22,7 @@ function forum_help($route_name, RouteMatchInterface $route_match) {
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Forum module lets you create threaded discussion forums with functionality similar to other message board systems. In a forum, users post topics and threads in nested hierarchies, allowing discussions to be categorized and grouped.') . '</p>';
$output .= '<p>' . t('The Forum module adds and uses a content type called <em>Forum topic</em>. For background information on content types, see the <a href=":node_help">Node module help page</a>.', array(':node_help'=>\Drupal::url('help.page', array('name' => 'node')))) . '</p>';
$output .= '<p>' . t('The Forum module adds and uses a content type called <em>Forum topic</em>. For background information on content types, see the <a href=":node_help">Node module help page</a>.', array(':node_help' => \Drupal::url('help.page', array('name' => 'node')))) . '</p>';
$output .= '<p>' . t('A forum is represented by a hierarchical structure, consisting of:');
$output .= '<ul>';
$output .= '<li>' . t('<em>Forums</em> (for example, <em>Recipes for cooking vegetables</em>)') . '</li>';
......
......@@ -28,7 +28,7 @@ function history_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.history':
$output = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The History module keeps track of which content a user has read. It marks content as <em>new</em> or <em>updated</em> depending on the last time the user viewed it. History records that are older than one month are removed during cron, which means that content older than one month is always considered <em>read</em>. The History module does not have a user interface but it provides a filter to <a href=":views-help">Views</a> to show new or updated content. For more information, see the <a href=":url">online documentation for the History module</a>.', array(':views-help' => (\Drupal::moduleHandler()->moduleExists('views')) ? \Drupal::url('help.page', array ('name' => 'views')): '#', ':url' => 'https://www.drupal.org/documentation/modules/history')) . '</p>';
$output .= '<p>' . t('The History module keeps track of which content a user has read. It marks content as <em>new</em> or <em>updated</em> depending on the last time the user viewed it. History records that are older than one month are removed during cron, which means that content older than one month is always considered <em>read</em>. The History module does not have a user interface but it provides a filter to <a href=":views-help">Views</a> to show new or updated content. For more information, see the <a href=":url">online documentation for the History module</a>.', array(':views-help' => (\Drupal::moduleHandler()->moduleExists('views')) ? \Drupal::url('help.page', array ('name' => 'views')) : '#', ':url' => 'https://www.drupal.org/documentation/modules/history')) . '</p>';
return $output;
}
}
......
......@@ -317,7 +317,7 @@ public function preSave() {
$image = \Drupal::service('image.factory')->get($this->entity->getFileUri());
if ($image->isValid()) {
$this->width = $image->getWidth();
$this->height =$image->getHeight();
$this->height = $image->getHeight();
}
}
}
......@@ -366,7 +366,7 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin
'target_id' => $file->id(),
'alt' => $random->sentences(4),
'title' => $random->sentences(4),
'width' =>$width,
'width' => $width,
'height' => $height,
);
return $values;
......
......@@ -208,7 +208,7 @@ public function testIsDefaultConfiguration(ContentLanguageSettings $config, $exp
}
public function providerIsDefaultConfiguration() {
$alteredLanguage= new ContentLanguageSettings(array(
$alteredLanguage = new ContentLanguageSettings(array(
'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_bundle',
), 'language_content_settings');
......@@ -271,7 +271,7 @@ public function testLoadByEntityTypeBundle($config_id, ContentLanguageSettings $
}
public function providerLoadByEntityTypeBundle() {
$alteredLanguage= new ContentLanguageSettings(array(
$alteredLanguage = new ContentLanguageSettings(array(
'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_bundle',
), 'language_content_settings');
......
......@@ -123,7 +123,7 @@ function testURLValidation() {
// https://www.drupal.org/node/2421941
'<front>' => '&lt;front&gt;',
'<front>#example' => '&lt;front&gt;#example',
'<front>?example=llama' =>'&lt;front&gt;?example=llama',
'<front>?example=llama' => '&lt;front&gt;?example=llama',
// Query string and fragment.
'?example=llama' => '?example=llama',
......
......@@ -469,7 +469,7 @@ protected function memoryExceeded() {
if ($pct_memory > $threshold) {
$this->message->display(
$this->t('Memory usage is @usage (@pct% of limit @limit), reclaiming memory.',
array('@pct' => round($pct_memory*100),
array('@pct' => round($pct_memory * 100),
'@usage' => $this->formatSize($usage),
'@limit' => $this->formatSize($this->memoryLimit))),
'warning');
......@@ -480,7 +480,7 @@ protected function memoryExceeded() {
if ($pct_memory > (0.90 * $threshold)) {
$this->message->display(
$this->t('Memory usage is now @usage (@pct% of limit @limit), not enough reclaimed, starting new batch',
array('@pct' => round($pct_memory*100),
array('@pct' => round($pct_memory * 100),
'@usage' => $this->formatSize($usage),
'@limit' => $this->formatSize($this->memoryLimit))),
'warning');
......@@ -489,7 +489,7 @@ protected function memoryExceeded() {
else {
$this->message->display(
$this->t('Memory usage is now @usage (@pct% of limit @limit), reclaimed enough, continuing',
array('@pct' => round($pct_memory*100),
array('@pct' => round($pct_memory * 100),
'@usage' => $this->formatSize($usage),
'@limit' => $this->formatSize($this->memoryLimit))),
'warning');
......
......@@ -147,7 +147,7 @@ protected function alterBuild(array &$build, EntityInterface $entity, EntityView
parent::alterBuild($build, $entity, $display, $view_mode);
if ($entity->id()) {
$build['#contextual_links']['node'] = array(
'route_parameters' =>array('node' => $entity->id()),
'route_parameters' => array('node' => $entity->id()),
'metadata' => array('changed' => $entity->getChangedTime()),
);
}
......
......@@ -41,7 +41,7 @@ function testLanguageNeutralUrl() {
$name = $this->randomMachineName(8);
$edit = array();
$edit['source'] = '/admin/config/search/path';
$edit['alias'] ='/' . $name;
$edit['alias'] = '/' . $name;
$this->drupalPostForm('admin/config/search/path/add', $edit, t('Save'));
$this->drupalGet($name);
......
......@@ -302,7 +302,7 @@ function rdf_preprocess_node(&$variables) {
$bundle = $variables['node']->bundle();
$mapping = rdf_get_mapping('node', $bundle);
$bundle_mapping = $mapping->getPreparedBundleMapping('node', $bundle);
$variables['attributes']['about'] = empty($variables['url']) ? NULL: $variables['url'];
$variables['attributes']['about'] = empty($variables['url']) ? NULL : $variables['url'];
$variables['attributes']['typeof'] = empty($bundle_mapping['types']) ? NULL : $bundle_mapping['types'];
// Adds RDFa markup for the node title as metadata because wrapping the title
......
......@@ -48,6 +48,6 @@ protected function setUp() {
* Tests the default formatter.
*/
public function testDefaultFormatter() {
$this->assertFormatterRdfa(array('type'=>'datetime_default'), 'http://schema.org/dateCreated', array('value' => $this->testValue . 'Z', 'type' => 'literal', 'datatype' => 'http://www.w3.org/2001/XMLSchema#dateTime'));
$this->assertFormatterRdfa(array('type' => 'datetime_default'), 'http://schema.org/dateCreated', array('value' => $this->testValue . 'Z', 'type' => 'literal', 'datatype' => 'http://www.w3.org/2001/XMLSchema#dateTime'));
}
}
......@@ -43,8 +43,8 @@ protected function setUp() {
*/
public function testAllFormatters() {
// Test the plain formatter.
$this->assertFormatterRdfa(array('type'=>'string'), 'http://schema.org/email', array('value' => $this->testValue));
$this->assertFormatterRdfa(array('type' => 'string'), 'http://schema.org/email', array('value' => $this->testValue));
// Test the mailto formatter.
$this->assertFormatterRdfa(array('type'=>'email_mailto'), 'http://schema.org/email', array('value' => $this->testValue));
$this->assertFormatterRdfa(array('type' => 'email_mailto'), 'http://schema.org/email', array('value' => $this->testValue));