-
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathPushRequest.php
More file actions
42 lines (32 loc) · 864 Bytes
/
Copy pathPushRequest.php
File metadata and controls
42 lines (32 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
declare(strict_types=1);
namespace Yiisoft\Queue\Middleware\Push;
use Yiisoft\Queue\Adapter\AdapterInterface;
use Yiisoft\Queue\Message\MessageInterface;
final class PushRequest
{
public function __construct(
private MessageInterface $message,
private AdapterInterface $adapter,
) {}
public function getMessage(): MessageInterface
{
return $this->message;
}
public function getAdapter(): AdapterInterface
{
return $this->adapter;
}
public function withMessage(MessageInterface $message): self
{
$instance = clone $this;
$instance->message = $message;
return $instance;
}
public function withAdapter(AdapterInterface $adapter): self
{
$instance = clone $this;
$instance->adapter = $adapter;
return $instance;
}
}