public static function createFromArray($name, array $data = [])
    {
        $type = parent::createFromArray($name, $data);
        \assert($type instanceof self);
        $type->setPossibleTypes(\explode('|', $type->getType()));
        $type->setType('union');

        if (isset($data['properties'])) {
            $type->setProperties($data['properties']);
        }

        if (isset($data['additionalProperties'])) {
            $type->setAdditionalProperties($data['additionalProperties']);
        }

        return $type;
    }
public static function createFromArray($name, array $data = [])
    {
        $type = parent::createFromArray($name, $data);
        \assert($type instanceof self);
        $type->setPossibleTypes(\explode('|', $type->getType()));
        $type->setType('union');

        if (isset($data['properties'])) {
            $type->setProperties($data['properties']);
        }

        if (isset($data['additionalProperties'])) {
            $type->setAdditionalProperties($data['additionalProperties']);
        }

        return $type;
    }
public static function createFromArray ( $ name , array $ data = [ ] ) { $ type = parent :: createFromArray ( $ name , $ data ) ; \ assert ( $ type instanceof self ) ; $ type -> setPossibleTypes ( \ explode ( '|' , $ type -> getType ( ) ) ) ; $ type -> setType ( 'union' ) ; if ( isset ( $ data [ 'properties' ] ) ) { $ type -> setProperties ( $ data [ 'properties' ] ) ; } if ( isset ( $ data [ 'additionalProperties' ] ) ) { $ type -> setAdditionalProperties ( $ data [ 'additionalProperties' ] ) ; } return $ type ; }
Create a new UnionType from an array of data

@param string $name

@return UnionType
Create a new UnionType from an array of data