@@ -26,7 +26,7 @@ class NullMessage implements PsrMessage
26
26
*/
27
27
private $ redelivered ;
28
28
29
- public function __construct ($ body = '' , array $ properties = [], array $ headers = [])
29
+ public function __construct (string $ body = '' , array $ properties = [], array $ headers = [])
30
30
{
31
31
$ this ->body = $ body ;
32
32
$ this ->properties = $ properties ;
@@ -35,173 +35,113 @@ public function __construct($body = '', array $properties = [], array $headers =
35
35
$ this ->redelivered = false ;
36
36
}
37
37
38
- /**
39
- * {@inheritdoc}
40
- */
41
- public function setBody ($ body )
38
+ public function setBody (string $ body ): void
42
39
{
43
40
$ this ->body = $ body ;
44
41
}
45
42
46
- /**
47
- * {@inheritdoc}
48
- */
49
- public function getBody ()
43
+ public function getBody (): string
50
44
{
51
45
return $ this ->body ;
52
46
}
53
47
54
- /**
55
- * {@inheritdoc}
56
- */
57
- public function setProperties (array $ properties )
48
+ public function setProperties (array $ properties ): void
58
49
{
59
50
$ this ->properties = $ properties ;
60
51
}
61
52
62
- /**
63
- * {@inheritdoc}
64
- */
65
- public function getProperties ()
53
+ public function getProperties (): array
66
54
{
67
55
return $ this ->properties ;
68
56
}
69
57
70
- /**
71
- * {@inheritdoc}
72
- */
73
- public function setProperty ($ name , $ value )
58
+ public function setProperty (string $ name , $ value ): void
74
59
{
75
60
$ this ->properties [$ name ] = $ value ;
76
61
}
77
62
78
- /**
79
- * {@inheritdoc}
80
- */
81
- public function getProperty ($ name , $ default = null )
63
+ public function getProperty (string $ name , $ default = null )
82
64
{
83
65
return array_key_exists ($ name , $ this ->properties ) ? $ this ->properties [$ name ] : $ default ;
84
66
}
85
67
86
- /**
87
- * {@inheritdoc}
88
- */
89
- public function setHeaders (array $ headers )
68
+ public function setHeaders (array $ headers ): void
90
69
{
91
70
$ this ->headers = $ headers ;
92
71
}
93
72
94
- /**
95
- * {@inheritdoc}
96
- */
97
- public function getHeaders ()
73
+ public function getHeaders (): array
98
74
{
99
75
return $ this ->headers ;
100
76
}
101
77
102
- /**
103
- * {@inheritdoc}
104
- */
105
- public function setHeader ($ name , $ value )
78
+ public function setHeader (string $ name , $ value ): void
106
79
{
107
80
$ this ->headers [$ name ] = $ value ;
108
81
}
109
82
110
- /**
111
- * {@inheritdoc}
112
- */
113
- public function getHeader ($ name , $ default = null )
83
+ public function getHeader (string $ name , $ default = null )
114
84
{
115
85
return array_key_exists ($ name , $ this ->headers ) ? $ this ->headers [$ name ] : $ default ;
116
86
}
117
87
118
- /**
119
- * {@inheritdoc}
120
- */
121
- public function isRedelivered ()
88
+ public function isRedelivered (): bool
122
89
{
123
90
return $ this ->redelivered ;
124
91
}
125
92
126
- /**
127
- * {@inheritdoc}
128
- */
129
- public function setRedelivered ($ redelivered )
93
+ public function setRedelivered (bool $ redelivered ): void
130
94
{
131
95
$ this ->redelivered = $ redelivered ;
132
96
}
133
97
134
- /**
135
- * {@inheritdoc}
136
- */
137
- public function setCorrelationId ($ correlationId )
98
+ public function setCorrelationId (string $ correlationId = null ): void
138
99
{
139
100
$ headers = $ this ->getHeaders ();
140
101
$ headers ['correlation_id ' ] = (string ) $ correlationId ;
141
102
142
103
$ this ->setHeaders ($ headers );
143
104
}
144
105
145
- /**
146
- * {@inheritdoc}
147
- */
148
- public function getCorrelationId ()
106
+ public function getCorrelationId (): ?string
149
107
{
150
108
return $ this ->getHeader ('correlation_id ' );
151
109
}
152
110
153
- /**
154
- * {@inheritdoc}
155
- */
156
- public function setMessageId ($ messageId )
111
+ public function setMessageId (string $ messageId = null ): void
157
112
{
158
113
$ headers = $ this ->getHeaders ();
159
114
$ headers ['message_id ' ] = (string ) $ messageId ;
160
115
161
116
$ this ->setHeaders ($ headers );
162
117
}
163
118
164
- /**
165
- * {@inheritdoc}
166
- */
167
- public function getMessageId ()
119
+ public function getMessageId (): ?string
168
120
{
169
121
return $ this ->getHeader ('message_id ' );
170
122
}
171
123
172
- /**
173
- * {@inheritdoc}
174
- */
175
- public function getTimestamp ()
124
+ public function getTimestamp (): ?int
176
125
{
177
126
$ value = $ this ->getHeader ('timestamp ' );
178
127
179
128
return null === $ value ? null : (int ) $ value ;
180
129
}
181
130
182
- /**
183
- * {@inheritdoc}
184
- */
185
- public function setTimestamp ($ timestamp )
131
+ public function setTimestamp (int $ timestamp = null ): void
186
132
{
187
133
$ headers = $ this ->getHeaders ();
188
134
$ headers ['timestamp ' ] = (int ) $ timestamp ;
189
135
190
136
$ this ->setHeaders ($ headers );
191
137
}
192
138
193
- /**
194
- * @param string|null $replyTo
195
- */
196
- public function setReplyTo ($ replyTo )
139
+ public function setReplyTo (string $ replyTo = null ): void
197
140
{
198
141
$ this ->setHeader ('reply_to ' , $ replyTo );
199
142
}
200
143
201
- /**
202
- * @return string|null
203
- */
204
- public function getReplyTo ()
144
+ public function getReplyTo (): ?string
205
145
{
206
146
return $ this ->getHeader ('reply_to ' );
207
147
}
0 commit comments