mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-18 16:37:43 +03:00
Remove deprecated getTimestamp*() methods
This commit is contained in:
@@ -164,36 +164,6 @@ trait DeprecatedUuidMethodsTrait
|
||||
return $this->fields->getNode()->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@see UuidInterface::getFields()} to get a
|
||||
* {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface}
|
||||
* instance, you may call {@see Rfc4122FieldsInterface::getTimestamp()}
|
||||
* and use the arbitrary-precision math library of your choice to
|
||||
* convert it to a string integer.
|
||||
*/
|
||||
public function getTimestamp(): string
|
||||
{
|
||||
if ($this->fields->getVersion() !== 1) {
|
||||
throw new UnsupportedOperationException('Not a time-based UUID');
|
||||
}
|
||||
|
||||
return $this->numberConverter->fromHex($this->fields->getTimestamp()->toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@see UuidInterface::getFields()} to get a
|
||||
* {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface}
|
||||
* instance, you may call {@see Rfc4122FieldsInterface::getTimestamp()}.
|
||||
*/
|
||||
public function getTimestampHex(): string
|
||||
{
|
||||
if ($this->fields->getVersion() !== 1) {
|
||||
throw new UnsupportedOperationException('Not a time-based UUID');
|
||||
}
|
||||
|
||||
return $this->fields->getTimestamp()->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This has moved to {@see Rfc4122FieldsInterface::getUrn()} and
|
||||
* is available on {@see \Ramsey\Uuid\Rfc4122\UuidV1},
|
||||
|
||||
Reference in New Issue
Block a user