Re-add the @pure annotations

These were removed in 691c2c816e but
should remain in the code base.
This commit is contained in:
Ben Ramsey
2025-06-22 17:58:34 -05:00
committed by Ben Ramsey
parent dbc810466d
commit df575bdb79
19 changed files with 99 additions and 1 deletions
+20
View File
@@ -252,11 +252,17 @@ class UuidFactory implements UuidFactoryInterface
$this->validator = $validator;
}
/**
* @pure
*/
public function fromBytes(string $bytes): UuidInterface
{
return $this->codec->decodeBytes($bytes);
}
/**
* @pure
*/
public function fromString(string $uuid): UuidInterface
{
$uuid = strtolower($uuid);
@@ -264,6 +270,9 @@ class UuidFactory implements UuidFactoryInterface
return $this->codec->decode($uuid);
}
/**
* @pure
*/
public function fromInteger(string $integer): UuidInterface
{
$hex = $this->numberConverter->toHex($integer);
@@ -284,6 +293,9 @@ class UuidFactory implements UuidFactoryInterface
return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_TIME);
}
/**
* @pure
*/
public function fromHexadecimal(Hexadecimal $hex): UuidInterface
{
return $this->codec->decode($hex->__toString());
@@ -312,6 +324,7 @@ class UuidFactory implements UuidFactoryInterface
/**
* @inheritDoc
* @pure
*/
public function uuid3($ns, string $name): UuidInterface
{
@@ -327,6 +340,7 @@ class UuidFactory implements UuidFactoryInterface
/**
* @inheritDoc
* @pure
*/
public function uuid5($ns, string $name): UuidInterface
{
@@ -377,6 +391,8 @@ class UuidFactory implements UuidFactoryInterface
* and 65 will be replaced with the UUID variant. You MUST NOT rely on these bits for your application needs.
*
* @return UuidInterface A UuidInterface instance that represents a version 8 UUID
*
* @pure
*/
public function uuid8(string $bytes): UuidInterface
{
@@ -391,6 +407,8 @@ class UuidFactory implements UuidFactoryInterface
* @param string $bytes The byte string from which to construct a UUID
*
* @return UuidInterface An instance of UuidInterface, created from the provided bytes
*
* @pure
*/
public function uuid(string $bytes): UuidInterface
{
@@ -406,6 +424,8 @@ class UuidFactory implements UuidFactoryInterface
* @param string $hashAlgorithm The hashing algorithm to use when hashing together the namespace and name
*
* @return UuidInterface An instance of UuidInterface, created by hashing together the provided namespace and name
*
* @pure
*/
private function uuidFromNsAndName(
UuidInterface | string $ns,