public function format($format = self::STANDARD)
    {
        $hexStr = strtolower($this->asHex());

        $parts = [
            substr($hexStr, 0, 8),
            substr($hexStr, 8, 4),
            substr($hexStr, 12, 4),
            substr($hexStr, 16, 4),
            substr($hexStr, 20)
        ];

        if ($format & self::UPPERCASE) {
            $parts = array_map(function ($v) {
                return strtoupper($v);
            }, $parts);
        }

        $separator = '';
        if ($format & self::HYPHENATED) {
            $separator = self::SEPERATOR_HYPHEN;
        }

        $formatted = implode($separator, $parts);

        if ($format & self::BRACES) {
            $formatted = sprintf('{%s}', $formatted);
        }

        return $formatted;
    }
public function format($format = self::STANDARD)
    {
        $hexStr = strtolower($this->asHex());

        $parts = [
            substr($hexStr, 0, 8),
            substr($hexStr, 8, 4),
            substr($hexStr, 12, 4),
            substr($hexStr, 16, 4),
            substr($hexStr, 20)
        ];

        if ($format & self::UPPERCASE) {
            $parts = array_map(function ($v) {
                return strtoupper($v);
            }, $parts);
        }

        $separator = '';
        if ($format & self::HYPHENATED) {
            $separator = self::SEPERATOR_HYPHEN;
        }

        $formatted = implode($separator, $parts);

        if ($format & self::BRACES) {
            $formatted = sprintf('{%s}', $formatted);
        }

        return $formatted;
    }
public function format ( $ format = self :: STANDARD ) { $ hexStr = strtolower ( $ this -> asHex ( ) ) ; $ parts = [ substr ( $ hexStr , 0 , 8 ) , substr ( $ hexStr , 8 , 4 ) , substr ( $ hexStr , 12 , 4 ) , substr ( $ hexStr , 16 , 4 ) , substr ( $ hexStr , 20 ) ] ; if ( $ format & self :: UPPERCASE ) { $ parts = array_map ( function ( $ v ) { return strtoupper ( $ v ) ; } , $ parts ) ; } $ separator = '' ; if ( $ format & self :: HYPHENATED ) { $ separator = self :: SEPERATOR_HYPHEN ; } $ formatted = implode ( $ separator , $ parts ) ; if ( $ format & self :: BRACES ) { $ formatted = sprintf ( '{%s}' , $ formatted ) ; } return $ formatted ; }
Outputs a 'formatted' version of the GUID string

The formatting will currently output something like "{74EC705A-AD08-42A6-BCC5-5B9F93FAB0F4}" as the GUID
representation.

Example:

```php
$guid = GUID::createFromHex('9a39ed24-1752-4459-9ac2-6b0e8f0dcec7');

echo $guid->format();
9a39ed24175244599ac26b0e8f0dcec7

echo $guid->format(GUID::FORMAT_BRACES | GUID::FORMAT_UPPERCASE);
{9a39ed24175244599ac26b0e8f0dcec7}

echo $guid->format(0);
9a39ed24175244599ac26b0e8f0dcec7
```

@param int $format

@return string
Outputs a formatted version of the GUID string