diff --git a/src/DeprecatedUuidInterface.php b/src/DeprecatedUuidInterface.php index ed6d9de..519dc44 100644 --- a/src/DeprecatedUuidInterface.php +++ b/src/DeprecatedUuidInterface.php @@ -123,12 +123,6 @@ interface DeprecatedUuidInterface */ public function getTimestampHex(): string; - /** - * @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 diff --git a/src/DeprecatedUuidMethodsTrait.php b/src/DeprecatedUuidMethodsTrait.php index 3428295..e6075d4 100644 --- a/src/DeprecatedUuidMethodsTrait.php +++ b/src/DeprecatedUuidMethodsTrait.php @@ -335,17 +335,6 @@ trait DeprecatedUuidMethodsTrait return $this->fields->getTimestamp()->toString(); } - /** - * @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 diff --git a/src/Rfc4122/UuidInterface.php b/src/Rfc4122/UuidInterface.php index 3e4d9fa..e80f33b 100644 --- a/src/Rfc4122/UuidInterface.php +++ b/src/Rfc4122/UuidInterface.php @@ -26,11 +26,4 @@ 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; } diff --git a/src/Uuid.php b/src/Uuid.php index 5f0922b..1a439b7 100644 --- a/src/Uuid.php +++ b/src/Uuid.php @@ -384,6 +384,11 @@ class Uuid implements UuidInterface return new IntegerObject($this->numberConverter->fromHex($this->getHex()->toString())); } + public function getUrn(): string + { + return 'urn:uuid:' . $this->toString(); + } + /** * @psalm-return non-empty-string */ diff --git a/src/UuidInterface.php b/src/UuidInterface.php index f22eb0f..5f41675 100644 --- a/src/UuidInterface.php +++ b/src/UuidInterface.php @@ -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 *