diff --git a/src/Handler/UnionHandler.php b/src/Handler/UnionHandler.php index 8e1f60009..5618cc40e 100644 --- a/src/Handler/UnionHandler.php +++ b/src/Handler/UnionHandler.php @@ -93,7 +93,7 @@ private function reorderTypes(array $type): array if ($type['params']) { uasort($type['params'], function($a, $b) { $order = ['null' => 0, 'true' => 1, 'false' => 2, 'bool' => 3, 'int' => 4, 'float' => 5, 'string' => 6]; - return $order[$a['name']] || 7 <=> $order[$b['name']] || 7; + return (array_key_exists($a['name'], $order) ? $order[$a['name']] : 7) <=> (array_key_exists($b['name'], $order) ? $order[$b['name']] : 7); }); } return $type;