@@ -101,7 +101,7 @@ public function setRedelivered(bool $redelivered): void
101
101
$ this ->redelivered = $ redelivered ;
102
102
}
103
103
104
- public function setCorrelationId (string $ correlationId = null ): void
104
+ public function setCorrelationId (? string $ correlationId = null ): void
105
105
{
106
106
$ this ->setHeader ('correlation_id ' , (string ) $ correlationId );
107
107
}
@@ -111,7 +111,7 @@ public function getCorrelationId(): ?string
111
111
return $ this ->getHeader ('correlation_id ' );
112
112
}
113
113
114
- public function setMessageId (string $ messageId = null ): void
114
+ public function setMessageId (? string $ messageId = null ): void
115
115
{
116
116
$ this ->setHeader ('message_id ' , (string ) $ messageId );
117
117
}
@@ -128,12 +128,12 @@ public function getTimestamp(): ?int
128
128
return null === $ value ? null : (int ) $ value ;
129
129
}
130
130
131
- public function setTimestamp (int $ timestamp = null ): void
131
+ public function setTimestamp (? int $ timestamp = null ): void
132
132
{
133
133
$ this ->setHeader ('timestamp ' , $ timestamp );
134
134
}
135
135
136
- public function setReplyTo (string $ replyTo = null ): void
136
+ public function setReplyTo (? string $ replyTo = null ): void
137
137
{
138
138
$ this ->setHeader ('reply_to ' , $ replyTo );
139
139
}
@@ -155,12 +155,8 @@ public function jsonSerialize(): array
155
155
public static function jsonUnserialize (string $ json ): self
156
156
{
157
157
$ data = json_decode ($ json , true );
158
- if (JSON_ERROR_NONE !== json_last_error ()) {
159
- throw new \InvalidArgumentException (sprintf (
160
- 'The malformed json given. Error %s and message %s ' ,
161
- json_last_error (),
162
- json_last_error_msg ()
163
- ));
158
+ if (\JSON_ERROR_NONE !== json_last_error ()) {
159
+ throw new \InvalidArgumentException (sprintf ('The malformed json given. Error %s and message %s ' , json_last_error (), json_last_error_msg ()));
164
160
}
165
161
166
162
return new self ($ data ['body ' ], $ data ['properties ' ], $ data ['headers ' ]);
@@ -171,7 +167,7 @@ public function getJob(): ?\GearmanJob
171
167
return $ this ->job ;
172
168
}
173
169
174
- public function setJob (\GearmanJob $ job = null ): void
170
+ public function setJob (? \GearmanJob $ job = null ): void
175
171
{
176
172
$ this ->job = $ job ;
177
173
}
0 commit comments