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 40
__construct(UuidBuilderInterface $builder)
Constructs a StringCodec for use encoding and decoding UUIDs
at line 51
string
encode(UuidInterface $uuid)
Encodes a UuidInterface as a string representation of a UUID
at line 67
string
encodeBinary(UuidInterface $uuid)
Encodes a UuidInterface as a binary representation of a UUID
at line 78
UuidInterface
decode(string $encodedUuid)
Decodes a string representation of a UUID into a UuidInterface object instance
at line 92
UuidInterface
decodeBytes(string $bytes)
Decodes a binary representation of a UUID into a UuidInterface object instance
at line 108
protected UuidBuilderInterface
getBuilder()
Returns the UUID builder
at line 119
protected array
extractComponents(string $encodedUuid)
Returns an array of UUID components (the UUID exploded on its dashes)
at line 156
protected array
getFields(array $components)
Returns the fields that make up this UUID