src/Graviton/SchemaBundle/Serializer/Handler/SchemaTypeHandler.php
public function serializeSchemaTypeToJson(
        JsonSerializationVisitor $visitor,
        SchemaType $schemaType,
        array $type,
        Context $context
    ) {
        $types = $schemaType->getTypes();

        if (count($types) === 1) {
            return array_pop($types);
        }

        return $types;
    }
public function serializeSchemaTypeToJson(
        JsonSerializationVisitor $visitor,
        SchemaType $schemaType,
        array $type,
        Context $context
    ) {
        $types = $schemaType->getTypes();

        if (count($types) === 1) {
            return array_pop($types);
        }

        return $types;
    }
public function serializeSchemaTypeToJson ( JsonSerializationVisitor $ visitor , SchemaType $ schemaType , array $ type , Context $ context ) { $ types = $ schemaType -> getTypes ( ) ; if ( count ( $ types ) === 1 ) { return array_pop ( $ types ) ; } return $ types ; }
Serialize SchemaType to JSON

@param JsonSerializationVisitor $visitor    Visitor
@param SchemaType               $schemaType type
@param array                    $type       Type
@param Context                  $context    Context

@return array
Serialize SchemaType to JSON