File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,10 @@ private function convertErrorConstants(string $expression): string
55
55
return $ errorConstant [0 ];
56
56
}, $ expression );
57
57
58
+ if (null === $ output ) {
59
+ throw new \InvalidArgumentException ('Unable to parse error types string: ' . $ expression );
60
+ }
61
+
58
62
return $ output ;
59
63
}
60
64
Original file line number Diff line number Diff line change @@ -20,4 +20,12 @@ public function test_error_types_parser_throws_exception_for_unwanted_values()
20
20
$ this ->expectException (\InvalidArgumentException::class);
21
21
$ ex ->parse ();
22
22
}
23
+
24
+ public function test_error_types_parser_throws_exception_for_unparsable_values ()
25
+ {
26
+ $ ex = new ErrorTypesParser ('something-wrong ' );
27
+
28
+ $ this ->expectException (\InvalidArgumentException::class);
29
+ $ ex ->parse ();
30
+ }
23
31
}
You can’t perform that action at this time.
0 commit comments