public static function structToString($struct, array $options = [])
    {
        $tb = new TomlBuilder();

        if ($struct instanceof \Traversable) {
            $struct = iterator_to_array($struct);
        } elseif (is_object($struct)) {
            $struct = get_object_vars($struct);
        } else {
            $struct = (array) $struct;
        }

        static::addValues($tb, $struct);

        return $tb->getTomlString();
    }
public static function structToString($struct, array $options = [])
    {
        $tb = new TomlBuilder();

        if ($struct instanceof \Traversable) {
            $struct = iterator_to_array($struct);
        } elseif (is_object($struct)) {
            $struct = get_object_vars($struct);
        } else {
            $struct = (array) $struct;
        }

        static::addValues($tb, $struct);

        return $tb->getTomlString();
    }
public static function structToString ( $ struct , array $ options = [ ] ) { $ tb = new TomlBuilder ( ) ; if ( $ struct instanceof \ Traversable ) { $ struct = iterator_to_array ( $ struct ) ; } elseif ( is_object ( $ struct ) ) { $ struct = get_object_vars ( $ struct ) ; } else { $ struct = ( array ) $ struct ; } static :: addValues ( $ tb , $ struct ) ; return $ tb -> getTomlString ( ) ; }
Converts an object into a formatted string.

@param object $struct  Data Source Object.
@param array  $options An array of options for the formatter.

@return  string  Formatted string.

@since   2.0
Converts an object into a formatted string .