diff -u b/core/lib/Drupal/Core/Datetime/DateHelper.php b/core/lib/Drupal/Core/Datetime/DateHelper.php --- b/core/lib/Drupal/Core/Datetime/DateHelper.php +++ b/core/lib/Drupal/Core/Datetime/DateHelper.php @@ -290,11 +290,12 @@ */ public static function years($min = 0, $max = 0, $required = FALSE) { // Ensure $min and $max are valid values. + $request_time = \Drupal::time()->getRequestTime(); if (empty($min)) { - $min = intval(date('Y', \Drupal::time()->getRequestTime()) - 3); + $min = intval(date('Y', $request_time) - 3); } if (empty($max)) { - $max = intval(date('Y', \Drupal::time()->getRequestTime()) + 3); + $max = intval(date('Y', $request_time) + 3); } $none = ['' => '']; $range = range($min, $max); diff -u b/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php b/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php --- b/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php +++ b/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php @@ -293,7 +293,8 @@ */ public static function onPostRowSave(MigratePostRowSaveEvent $event) { // We want to interrupt this batch and start a fresh one. - if ((\Drupal::time()->getCurrentTime() - \Drupal::time()->getRequestTime()) > static::$maxExecTime) { + $time = \Drupal::time(); + if (($time->getCurrentTime() - $time->getRequestTime()) > static::$maxExecTime) { $event->getMigration()->interruptMigration(MigrationInterface::RESULT_INCOMPLETE); } } @@ -324,7 +325,8 @@ */ public static function onPostRowDelete(MigrateRowDeleteEvent $event) { // We want to interrupt this batch and start a fresh one. - if ((\Drupal::time()->getCurrentTime() - \Drupal::time()->getRequestTime()) > static::$maxExecTime) { + $time = \Drupal::time(); + if (($time->getCurrentTime() - $time->getRequestTime()) > static::$maxExecTime) { $event->getMigration()->interruptMigration(MigrationInterface::RESULT_INCOMPLETE); } } diff -u b/core/phpstan-baseline.neon b/core/phpstan-baseline.neon --- b/core/phpstan-baseline.neon +++ b/core/phpstan-baseline.neon @@ -1682,9 +1682,4 @@ - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 2 - path: modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php - - - message: "#^Variable \\$connection might not be defined\\.$#" count: 2