PHP 8: Deprecated function: Implicit conversion from float to int loses precision

Created on 1 June 2023, about 1 year ago
Updated 4 July 2023, 12 months ago

Problem/Motivation

MigrateToolsCommands::status() dateFormatter call throws error

Deprecated function: Implicit conversion from float 1685586398.156 to int loses precision in Drupal\Component\Datetime\DateTimePlus->__call()

Steps to reproduce

    $migrationPluginManager = \Drupal::service('plugin.manager.migration');
    $dateFormatter = \Drupal::service('date.formatter');
    $entityTypeManager = \Drupal::service('entity_type.manager');
    $keyValue = \Drupal::service('keyvalue');
    $instance = new MigrateToolsCommands(
      $migrationPluginManager, $dateFormatter, $entityTypeManager, $keyValue
    );

    $status = $instance->status('', [
      'group' => '',
      'tag' => '',
      'names-only' => FALSE,
      'continue-on-failure' => TRUE,
    ]);

Proposed resolution

Cast `$last_imported / 1000` as (int)

Remaining tasks

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia AlMunnings Melbourne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024