File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -298,11 +298,6 @@ public function toArray(): array
298
298
public static function fromArray (array $ array ): self
299
299
{
300
300
if (isset ($ array [self ::KEY_CHANNEL ])) {
301
- if (!MessagePartChannelEnum::isValidValue ($ array [self ::KEY_CHANNEL ])) {
302
- throw new InvalidArgumentException (
303
- sprintf ('Invalid channel value: %s ' , $ array [self ::KEY_CHANNEL ])
304
- );
305
- }
306
301
$ channel = MessagePartChannelEnum::from ($ array [self ::KEY_CHANNEL ]);
307
302
} else {
308
303
$ channel = null ;
Original file line number Diff line number Diff line change @@ -427,7 +427,9 @@ public function testCreateWithDifferentChannels(): void
427
427
public function testFromArrayWithInvalidChannel (): void
428
428
{
429
429
$ this ->expectException (InvalidArgumentException::class);
430
- $ this ->expectExceptionMessage ('Invalid channel value: invalid_channel ' );
430
+ $ this ->expectExceptionMessage (
431
+ 'invalid_channel is not a valid backing value for enum ' . MessagePartChannelEnum::class
432
+ );
431
433
432
434
$ json = [
433
435
MessagePart::KEY_CHANNEL => 'invalid_channel ' ,
You can’t perform that action at this time.
0 commit comments