function GuidBuilder::build
Builds and returns a Guid
@psalm-pure
Parameters
CodecInterface $codec The codec to use for building this Guid instance:
string $bytes The byte string from which to construct a UUID:
Return value
Guid The GuidBuilder returns an instance of Ramsey\Uuid\Guid\Guid
Overrides UuidBuilderInterface::build
File
-
vendor/
ramsey/ uuid/ src/ Guid/ GuidBuilder.php, line 56
Class
- GuidBuilder
- GuidBuilder builds instances of Guid
Namespace
Ramsey\Uuid\GuidCode
public function build(CodecInterface $codec, string $bytes) : UuidInterface {
try {
return new Guid($this->buildFields($bytes), $this->numberConverter, $codec, $this->timeConverter);
} catch (Throwable $e) {
throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e);
}
}