StringCodec
class StringCodec implements CodecInterface (View source)
StringCodec encodes and decodes RFC 4122 UUIDs
Methods
Constructs a StringCodec for use encoding and decoding UUIDs
Decodes a string representation of a UUID into a UuidInterface object instance
Decodes a binary representation of a UUID into a UuidInterface object instance
Returns the UUID builder
Returns an array of UUID components (the UUID exploded on its dashes)
Returns the fields that make up this UUID
Details
at line 39
__construct(UuidBuilderInterface $builder)
Constructs a StringCodec for use encoding and decoding UUIDs
at line 50
string
encode(UuidInterface $uuid)
Encodes a UuidInterface as a string representation of a UUID
at line 66
string
encodeBinary(UuidInterface $uuid)
Encodes a UuidInterface as a binary representation of a UUID
at line 77
UuidInterface
decode(string $encodedUuid)
Decodes a string representation of a UUID into a UuidInterface object instance
at line 91
UuidInterface
decodeBytes(string $bytes)
Decodes a binary representation of a UUID into a UuidInterface object instance
at line 107
protected UuidBuilderInterface
getBuilder()
Returns the UUID builder
at line 118
protected array
extractComponents(string $encodedUuid)
Returns an array of UUID components (the UUID exploded on its dashes)
at line 155
protected array
getFields(array $components)
Returns the fields that make up this UUID