Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor
  • Loading branch information
WendellAdriel committed Sep 14, 2025
commit 4050b1a8fbf9a93ed6739299e713cb5797c21318
17 changes: 6 additions & 11 deletions src/Illuminate/Http/Client/Batch.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,42 +38,42 @@ class Batch
*
* @var int
*/
public $totalRequests;
public $totalRequests = 0;

/**
* The total number of requests that are still pending.
*
* @var int
*/
public $pendingRequests;
public $pendingRequests = 0;

/**
* The total number of requests that have failed.
*
* @var int
*/
public $failedRequests;
public $failedRequests = 0;

/**
* The date indicating when the batch was created.
*
* @var \Carbon\CarbonImmutable
*/
public $createdAt;
public $createdAt = null;

/**
* The date indicating when the batch was cancelled.
*
* @var \Carbon\CarbonImmutable|null
*/
public $cancelledAt;
public $cancelledAt = null;

/**
* The date indicating when the batch was finished.
*
* @var \Carbon\CarbonImmutable|null
*/
public $finishedAt;
public $finishedAt = null;

/**
* The callback to run before the first request from the batch runs.
Expand Down Expand Up @@ -114,12 +114,7 @@ public function __construct(?Factory $factory = null)
{
$this->factory = $factory ?: new Factory();
$this->handler = Utils::chooseHandler();

$this->totalRequests = 0;
$this->pendingRequests = 0;
$this->failedRequests = 0;
$this->createdAt = new CarbonImmutable();
$this->finishedAt = null;
}

/**
Expand Down