Skip to content

Commit 38efafc

Browse files
committed
add some PHPDocs to QueuePushResult class
1 parent 2d754b8 commit 38efafc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/QueuePushResult.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
namespace CodeIgniter\Queue;
1515

16+
/**
17+
* Represents the result of a queue push operation.
18+
*/
1619
class QueuePushResult
1720
{
1821
public function __construct(
@@ -22,26 +25,41 @@ public function __construct(
2225
) {
2326
}
2427

28+
/**
29+
* Creates a successful push result.
30+
*/
2531
public static function success(int $jobId): self
2632
{
2733
return new self(true, $jobId);
2834
}
2935

36+
/**
37+
* Creates a failed push result.
38+
*/
3039
public static function failure(?string $error = null): self
3140
{
3241
return new self(false, null, $error);
3342
}
3443

44+
/**
45+
* Returns whether the push operation was successful.
46+
*/
3547
public function getStatus(): bool
3648
{
3749
return $this->success;
3850
}
3951

52+
/**
53+
* Returns the job ID if the push was successful, null otherwise.
54+
*/
4055
public function getJobId(): ?int
4156
{
4257
return $this->jobId;
4358
}
4459

60+
/**
61+
* Returns the error message if the push failed, null otherwise.
62+
*/
4563
public function getError(): ?string
4664
{
4765
return $this->error;

0 commit comments

Comments
 (0)