mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-27 17:56:36 +03:00
Re-add the @pure annotations
These were removed in 691c2c816e but
should remain in the code base.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user