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)
177177 public static function __callStatic ($ name , $ arguments )
178178 {
179179 $ array = static ::toArray ();
180- if (isset ( $ array [ $ name] )) {
180+ if (array_key_exists ( $ name, $ array )) {
181181 return new static ($ array [$ name ]);
182182 }
183183
Original file line number Diff line number Diff line change @@ -262,4 +262,11 @@ public function testJsonSerialize()
262262 $ this ->assertJsonStringEqualsJsonString ('"" ' , json_encode (new EnumFixture (EnumFixture::PROBLEMATIC_EMPTY_STRING )));
263263 $ this ->assertJsonStringEqualsJsonString ('false ' , json_encode (new EnumFixture (EnumFixture::PROBLEMATIC_BOOLEAN_FALSE )));
264264 }
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+ }
265272}
You can’t perform that action at this time.
0 commit comments