Replaced instanceof check with is_array for shorthand notation of field definitions (as instanceof might be pretty slow)

This commit is contained in:
vladar 2016-10-20 19:15:20 +07:00
parent 5148c3bf03
commit fc37515ec2

View File

@ -95,7 +95,7 @@ class FieldDefinition
{ {
$map = []; $map = [];
foreach ($fields as $name => $field) { foreach ($fields as $name => $field) {
if ($field instanceof Type) { if (!is_array($field)) {
$field = ['type' => $field]; $field = ['type' => $field];
} }
if (!isset($field['name'])) { if (!isset($field['name'])) {