@@ -40,39 +40,39 @@ public function __construct(Connection $connection, SerializerInterface $seriali
40
40
*/
41
41
public function get (): iterable
42
42
{
43
- return ( $ this ->receiver ?? $ this -> getReceiver () )->get ();
43
+ return $ this ->getReceiver ()->get ();
44
44
}
45
45
46
46
/**
47
47
* {@inheritdoc}
48
48
*/
49
49
public function getFromQueues (array $ queueNames ): iterable
50
50
{
51
- return ( $ this ->receiver ?? $ this -> getReceiver () )->getFromQueues ($ queueNames );
51
+ return $ this ->getReceiver ()->getFromQueues ($ queueNames );
52
52
}
53
53
54
54
/**
55
55
* {@inheritdoc}
56
56
*/
57
57
public function ack (Envelope $ envelope ): void
58
58
{
59
- ( $ this ->receiver ?? $ this -> getReceiver () )->ack ($ envelope );
59
+ $ this ->getReceiver ()->ack ($ envelope );
60
60
}
61
61
62
62
/**
63
63
* {@inheritdoc}
64
64
*/
65
65
public function reject (Envelope $ envelope ): void
66
66
{
67
- ( $ this ->receiver ?? $ this -> getReceiver () )->reject ($ envelope );
67
+ $ this ->getReceiver ()->reject ($ envelope );
68
68
}
69
69
70
70
/**
71
71
* {@inheritdoc}
72
72
*/
73
73
public function send (Envelope $ envelope ): Envelope
74
74
{
75
- return ( $ this ->sender ?? $ this -> getSender () )->send ($ envelope );
75
+ return $ this ->getSender ()->send ($ envelope );
76
76
}
77
77
78
78
/**
@@ -88,17 +88,17 @@ public function setup(): void
88
88
*/
89
89
public function getMessageCount (): int
90
90
{
91
- return ( $ this ->receiver ?? $ this -> getReceiver () )->getMessageCount ();
91
+ return $ this ->getReceiver ()->getMessageCount ();
92
92
}
93
93
94
94
private function getReceiver (): AmqpReceiver
95
95
{
96
- return $ this ->receiver = new AmqpReceiver ($ this ->connection , $ this ->serializer );
96
+ return $ this ->receiver ?? = new AmqpReceiver ($ this ->connection , $ this ->serializer );
97
97
}
98
98
99
99
private function getSender (): AmqpSender
100
100
{
101
- return $ this ->sender = new AmqpSender ($ this ->connection , $ this ->serializer );
101
+ return $ this ->sender ?? = new AmqpSender ($ this ->connection , $ this ->serializer );
102
102
}
103
103
}
104
104
0 commit comments