function Uuid::fromHexadecimal
Creates a UUID from the Hexadecimal object
@psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, but under constant factory setups, this method operates in functionally pure manners @psalm-suppress MixedInferredReturnType,MixedReturnStatement
Parameters
Hexadecimal $hex Hexadecimal object representing a hexadecimal number:
Return value
UuidInterface A UuidInterface instance created from the Hexadecimal object representing a hexadecimal number
File
-
vendor/
ramsey/ uuid/ src/ Uuid.php, line 530
Class
- Uuid
- Uuid provides constants and static methods for working with and generating UUIDs
Namespace
Ramsey\UuidCode
public static function fromHexadecimal(Hexadecimal $hex) : UuidInterface {
$factory = self::getFactory();
if (method_exists($factory, 'fromHexadecimal')) {
/**
* @phpstan-ignore-next-line
* @psalm-suppress UndefinedInterfaceMethod
*/
return self::getFactory()->fromHexadecimal($hex);
}
throw new BadMethodCallException('The method fromHexadecimal() does not exist on the provided factory');
}