@@ -26,7 +26,7 @@ class NullMessage implements PsrMessage
2626 */
2727 private $ redelivered ;
2828
29- public function __construct ($ body = '' , array $ properties = [], array $ headers = [])
29+ public function __construct (string $ body = '' , array $ properties = [], array $ headers = [])
3030 {
3131 $ this ->body = $ body ;
3232 $ this ->properties = $ properties ;
@@ -35,173 +35,113 @@ public function __construct($body = '', array $properties = [], array $headers =
3535 $ this ->redelivered = false ;
3636 }
3737
38- /**
39- * {@inheritdoc}
40- */
41- public function setBody ($ body )
38+ public function setBody (string $ body ): void
4239 {
4340 $ this ->body = $ body ;
4441 }
4542
46- /**
47- * {@inheritdoc}
48- */
49- public function getBody ()
43+ public function getBody (): string
5044 {
5145 return $ this ->body ;
5246 }
5347
54- /**
55- * {@inheritdoc}
56- */
57- public function setProperties (array $ properties )
48+ public function setProperties (array $ properties ): void
5849 {
5950 $ this ->properties = $ properties ;
6051 }
6152
62- /**
63- * {@inheritdoc}
64- */
65- public function getProperties ()
53+ public function getProperties (): array
6654 {
6755 return $ this ->properties ;
6856 }
6957
70- /**
71- * {@inheritdoc}
72- */
73- public function setProperty ($ name , $ value )
58+ public function setProperty (string $ name , $ value ): void
7459 {
7560 $ this ->properties [$ name ] = $ value ;
7661 }
7762
78- /**
79- * {@inheritdoc}
80- */
81- public function getProperty ($ name , $ default = null )
63+ public function getProperty (string $ name , $ default = null )
8264 {
8365 return array_key_exists ($ name , $ this ->properties ) ? $ this ->properties [$ name ] : $ default ;
8466 }
8567
86- /**
87- * {@inheritdoc}
88- */
89- public function setHeaders (array $ headers )
68+ public function setHeaders (array $ headers ): void
9069 {
9170 $ this ->headers = $ headers ;
9271 }
9372
94- /**
95- * {@inheritdoc}
96- */
97- public function getHeaders ()
73+ public function getHeaders (): array
9874 {
9975 return $ this ->headers ;
10076 }
10177
102- /**
103- * {@inheritdoc}
104- */
105- public function setHeader ($ name , $ value )
78+ public function setHeader (string $ name , $ value ): void
10679 {
10780 $ this ->headers [$ name ] = $ value ;
10881 }
10982
110- /**
111- * {@inheritdoc}
112- */
113- public function getHeader ($ name , $ default = null )
83+ public function getHeader (string $ name , $ default = null )
11484 {
11585 return array_key_exists ($ name , $ this ->headers ) ? $ this ->headers [$ name ] : $ default ;
11686 }
11787
118- /**
119- * {@inheritdoc}
120- */
121- public function isRedelivered ()
88+ public function isRedelivered (): bool
12289 {
12390 return $ this ->redelivered ;
12491 }
12592
126- /**
127- * {@inheritdoc}
128- */
129- public function setRedelivered ($ redelivered )
93+ public function setRedelivered (bool $ redelivered ): void
13094 {
13195 $ this ->redelivered = $ redelivered ;
13296 }
13397
134- /**
135- * {@inheritdoc}
136- */
137- public function setCorrelationId ($ correlationId )
98+ public function setCorrelationId (string $ correlationId = null ): void
13899 {
139100 $ headers = $ this ->getHeaders ();
140101 $ headers ['correlation_id ' ] = (string ) $ correlationId ;
141102
142103 $ this ->setHeaders ($ headers );
143104 }
144105
145- /**
146- * {@inheritdoc}
147- */
148- public function getCorrelationId ()
106+ public function getCorrelationId (): ?string
149107 {
150108 return $ this ->getHeader ('correlation_id ' );
151109 }
152110
153- /**
154- * {@inheritdoc}
155- */
156- public function setMessageId ($ messageId )
111+ public function setMessageId (string $ messageId = null ): void
157112 {
158113 $ headers = $ this ->getHeaders ();
159114 $ headers ['message_id ' ] = (string ) $ messageId ;
160115
161116 $ this ->setHeaders ($ headers );
162117 }
163118
164- /**
165- * {@inheritdoc}
166- */
167- public function getMessageId ()
119+ public function getMessageId (): ?string
168120 {
169121 return $ this ->getHeader ('message_id ' );
170122 }
171123
172- /**
173- * {@inheritdoc}
174- */
175- public function getTimestamp ()
124+ public function getTimestamp (): ?int
176125 {
177126 $ value = $ this ->getHeader ('timestamp ' );
178127
179128 return null === $ value ? null : (int ) $ value ;
180129 }
181130
182- /**
183- * {@inheritdoc}
184- */
185- public function setTimestamp ($ timestamp )
131+ public function setTimestamp (int $ timestamp = null ): void
186132 {
187133 $ headers = $ this ->getHeaders ();
188134 $ headers ['timestamp ' ] = (int ) $ timestamp ;
189135
190136 $ this ->setHeaders ($ headers );
191137 }
192138
193- /**
194- * @param string|null $replyTo
195- */
196- public function setReplyTo ($ replyTo )
139+ public function setReplyTo (string $ replyTo = null ): void
197140 {
198141 $ this ->setHeader ('reply_to ' , $ replyTo );
199142 }
200143
201- /**
202- * @return string|null
203- */
204- public function getReplyTo ()
144+ public function getReplyTo (): ?string
205145 {
206146 return $ this ->getHeader ('reply_to ' );
207147 }
0 commit comments