File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ public static function search($value)
177
177
public static function __callStatic ($ name , $ arguments )
178
178
{
179
179
$ array = static ::toArray ();
180
- if (isset ( $ array [ $ name] )) {
180
+ if (array_key_exists ( $ name, $ array )) {
181
181
return new static ($ array [$ name ]);
182
182
}
183
183
Original file line number Diff line number Diff line change @@ -262,4 +262,11 @@ public function testJsonSerialize()
262
262
$ this ->assertJsonStringEqualsJsonString ('"" ' , json_encode (new EnumFixture (EnumFixture::PROBLEMATIC_EMPTY_STRING )));
263
263
$ this ->assertJsonStringEqualsJsonString ('false ' , json_encode (new EnumFixture (EnumFixture::PROBLEMATIC_BOOLEAN_FALSE )));
264
264
}
265
+
266
+ public function testNullableEnum ()
267
+ {
268
+ $ this ->assertNull (EnumFixture::PROBLEMATIC_NULL ()->getValue ());
269
+ $ this ->assertNull ((new EnumFixture (EnumFixture::PROBLEMATIC_NULL ))->getValue ());
270
+ $ this ->assertNull ((new EnumFixture (EnumFixture::PROBLEMATIC_NULL ))->jsonSerialize ());
271
+ }
265
272
}
You can’t perform that action at this time.
0 commit comments