mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-25 17:45:35 +03:00
Merge branch '4.x' into 5.x
This commit is contained in:
@@ -37,12 +37,6 @@ interface DeprecatedUuidInterface
|
||||
*/
|
||||
public function getDateTime(): DateTimeInterface;
|
||||
|
||||
/**
|
||||
* @deprecated In ramsey/uuid version 5.0.0, this will be removed from this
|
||||
* interface. It has moved to {@see \Ramsey\Uuid\Rfc4122\UuidInterface::getUrn()}.
|
||||
*/
|
||||
public function getUrn(): string;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@see UuidInterface::getFields()} to get a
|
||||
* {@see FieldsInterface} instance. If it is a
|
||||
|
||||
@@ -88,17 +88,6 @@ trait DeprecatedUuidMethodsTrait
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This has moved to {@see Rfc4122FieldsInterface::getUrn()} and
|
||||
* is available on {@see \Ramsey\Uuid\Rfc4122\UuidV1},
|
||||
* {@see \Ramsey\Uuid\Rfc4122\UuidV3}, {@see \Ramsey\Uuid\Rfc4122\UuidV4},
|
||||
* and {@see \Ramsey\Uuid\Rfc4122\UuidV5}.
|
||||
*/
|
||||
public function getUrn(): string
|
||||
{
|
||||
return 'urn:uuid:' . $this->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@see UuidInterface::getFields()} to get a
|
||||
* {@see FieldsInterface} instance. If it is a
|
||||
|
||||
@@ -26,13 +26,5 @@ use Ramsey\Uuid\UuidInterface as BaseUuidInterface;
|
||||
*/
|
||||
interface UuidInterface extends BaseUuidInterface
|
||||
{
|
||||
/**
|
||||
* Returns the string standard representation of the UUID as a URN
|
||||
*
|
||||
* @link http://en.wikipedia.org/wiki/Uniform_Resource_Name Uniform Resource Name
|
||||
* @link https://tools.ietf.org/html/rfc4122#section-3 RFC 4122, § 3: Namespace Registration Template
|
||||
*/
|
||||
public function getUrn(): string;
|
||||
|
||||
public function getFields(): FieldsInterface;
|
||||
}
|
||||
|
||||
@@ -384,6 +384,11 @@ class Uuid implements Rfc4122UuidInterface
|
||||
return new IntegerObject($this->numberConverter->fromHex($this->getHex()->toString()));
|
||||
}
|
||||
|
||||
public function getUrn(): string
|
||||
{
|
||||
return 'urn:uuid:' . $this->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-return non-empty-string
|
||||
*/
|
||||
|
||||
@@ -83,6 +83,14 @@ interface UuidInterface extends
|
||||
*/
|
||||
public function getInteger(): IntegerObject;
|
||||
|
||||
/**
|
||||
* Returns the string standard representation of the UUID as a URN
|
||||
*
|
||||
* @link http://en.wikipedia.org/wiki/Uniform_Resource_Name Uniform Resource Name
|
||||
* @link https://tools.ietf.org/html/rfc4122#section-3 RFC 4122, § 3: Namespace Registration Template
|
||||
*/
|
||||
public function getUrn(): string;
|
||||
|
||||
/**
|
||||
* Returns the string standard representation of the UUID
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user