Skip to content
Snippets Groups Projects
Commit 8e56a527 authored by catch's avatar catch
Browse files

Issue #3236798 by alexpott:...

Issue #3236798 by alexpott: \Drupal\Core\Datetime\DateFormatter::formatInterval() causes deprecations in PHP 8.1
parent 4c0d316a
No related branches found
No related tags found
13 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1896Issue #2940605: Can only intentionally re-render an entity with references 20 times,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!872Draft: Issue #3221319: Race condition when creating menu links and editing content deletes menu links,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493,!512Issue #3207771: Menu UI node type form documentation points to non-existent function,!485Sets the autocomplete attribute for username/password input field on login form.,!449Issue #2784233: Allow multiple vocabularies in the taxonomy filter,!231Issue #2671162: summary text wysiwyg patch working fine on 9.2.0-dev,!43Resolve #3173180: Add UI for 'loading' html attribute to images,!30Issue #3182188: Updates composer usage to point at ./vendor/bin/composer
...@@ -360,9 +360,9 @@ function _batch_process() { ...@@ -360,9 +360,9 @@ function _batch_process() {
'@total' => $total, '@total' => $total,
'@current' => floor($current), '@current' => floor($current),
'@percentage' => $percentage, '@percentage' => $percentage,
'@elapsed' => \Drupal::service('date.formatter')->formatInterval($elapsed / 1000), '@elapsed' => \Drupal::service('date.formatter')->formatInterval((int) ($elapsed / 1000)),
// If possible, estimate remaining processing time. // If possible, estimate remaining processing time.
'@estimate' => ($current > 0) ? \Drupal::service('date.formatter')->formatInterval(($elapsed * ($total - $current) / $current) / 1000) : '-', '@estimate' => ($current > 0) ? \Drupal::service('date.formatter')->formatInterval((int) (($elapsed * ($total - $current) / $current) / 1000)) : '-',
]; ];
$message = strtr($progress_message, $values); $message = strtr($progress_message, $values);
...@@ -453,7 +453,7 @@ function _batch_finished() { ...@@ -453,7 +453,7 @@ function _batch_finished() {
if (is_callable($batch_set['finished'])) { if (is_callable($batch_set['finished'])) {
$queue = _batch_queue($batch_set); $queue = _batch_queue($batch_set);
$operations = $queue->getAllItems(); $operations = $queue->getAllItems();
$batch_set_result = call_user_func_array($batch_set['finished'], [$batch_set['success'], $batch_set['results'], $operations, \Drupal::service('date.formatter')->formatInterval($batch_set['elapsed'] / 1000)]); $batch_set_result = call_user_func_array($batch_set['finished'], [$batch_set['success'], $batch_set['results'], $operations, \Drupal::service('date.formatter')->formatInterval((int) ($batch_set['elapsed'] / 1000))]);
// If a batch 'finished' callback requested a redirect after the batch // If a batch 'finished' callback requested a redirect after the batch
// is complete, save that for later use. If more than one batch set // is complete, save that for later use. If more than one batch set
// returned a redirect, the last one is used. // returned a redirect, the last one is used.
......
...@@ -82,7 +82,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ...@@ -82,7 +82,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
*/ */
public function render(ResultRow $values) { public function render(ResultRow $values) {
$value = $values->{$this->field_alias}; $value = $values->{$this->field_alias};
return $this->dateFormatter->formatInterval($value, isset($this->options['granularity']) ? $this->options['granularity'] : 2); return $this->dateFormatter->formatInterval((int) $value, isset($this->options['granularity']) ? $this->options['granularity'] : 2);
} }
} }
...@@ -1311,7 +1311,7 @@ function simpletest_script_reporter_write_xml_results() { ...@@ -1311,7 +1311,7 @@ function simpletest_script_reporter_write_xml_results() {
function simpletest_script_reporter_timer_stop() { function simpletest_script_reporter_timer_stop() {
echo "\n"; echo "\n";
$end = Timer::stop('run-tests'); $end = Timer::stop('run-tests');
echo "Test run duration: " . \Drupal::service('date.formatter')->formatInterval($end['time'] / 1000); echo "Test run duration: " . \Drupal::service('date.formatter')->formatInterval((int) ($end['time'] / 1000));
echo "\n\n"; echo "\n\n";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment