diff --git a/core/includes/batch.inc b/core/includes/batch.inc
index dd5da074c4f669c2837a57e1fb5e20634cd2d402..b187dcd5170a6962db1b78f0f302ba68b60f4a71 100644
--- a/core/includes/batch.inc
+++ b/core/includes/batch.inc
@@ -75,6 +75,7 @@ function _batch_page(Request $request) {
     }
   }
 
+  $response = FALSE;
   $op = $request->query->get('op', '');
   switch ($op) {
     case 'start':
@@ -345,14 +346,14 @@ function _batch_process() {
     }
     else {
       // Processing will continue with the current batch set.
-      $remaining        = $old_set['count'];
-      $total            = $old_set['total'];
-      $progress_message = $old_set['progress_message'];
+      $remaining        = $old_set['count'] ?? 0;
+      $total            = $old_set['total'] ?? 0;
+      $progress_message = $old_set['progress_message'] ?? '';
     }
 
     // Total progress is the number of operations that have fully run plus the
     // completion level of the current operation.
-    $current    = $total - $remaining + $finished;
+    $current    = $total - $remaining + ($finished ?? 0);
     $percentage = _batch_api_percentage($total, $current);
     $elapsed    = $current_set['elapsed'] ?? 0;
     $values     = [
diff --git a/core/phpstan-baseline.neon b/core/phpstan-baseline.neon
index 4b0b775af4c08d0a6ee61b157bce3ec1ae87edf4..f01dc5972b91c26879b3839ca5b5530a16ffad7f 100644
--- a/core/phpstan-baseline.neon
+++ b/core/phpstan-baseline.neon
@@ -15,21 +15,6 @@ parameters:
 			count: 1
 			path: assets/scaffold/files/default.settings.php
 
-		-
-			message: "#^Variable \\$finished might not be defined\\.$#"
-			count: 1
-			path: includes/batch.inc
-
-		-
-			message: "#^Variable \\$old_set might not be defined\\.$#"
-			count: 3
-			path: includes/batch.inc
-
-		-
-			message: "#^Variable \\$response might not be defined\\.$#"
-			count: 1
-			path: includes/batch.inc
-
 		-
 			message: "#^Variable \\$new_set_index might not be defined\\.$#"
 			count: 1