DeprecatedUuidInterface.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?php
  2. /**
  3. * This file is part of the ramsey/uuid library
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. *
  8. * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
  9. * @license http://opensource.org/licenses/MIT MIT
  10. */
  11. declare(strict_types=1);
  12. namespace Ramsey\Uuid;
  13. use DateTimeInterface;
  14. use Ramsey\Uuid\Converter\NumberConverterInterface;
  15. /**
  16. * This interface encapsulates deprecated methods for ramsey/uuid; this
  17. * interface and its methods will be removed in ramsey/uuid 5.0.0.
  18. *
  19. * @psalm-immutable
  20. */
  21. interface DeprecatedUuidInterface
  22. {
  23. /**
  24. * @deprecated This method will be removed in 5.0.0. There is no alternative
  25. * recommendation, so plan accordingly.
  26. */
  27. public function getNumberConverter(): NumberConverterInterface;
  28. /**
  29. * @deprecated Use {@see UuidInterface::getFields()} to get a
  30. * {@see FieldsInterface} instance.
  31. *
  32. * @return string[]
  33. */
  34. public function getFieldsHex(): array;
  35. /**
  36. * @deprecated Use {@see UuidInterface::getFields()} to get a
  37. * {@see FieldsInterface} instance. If it is a
  38. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call
  39. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()}.
  40. */
  41. public function getClockSeqHiAndReservedHex(): string;
  42. /**
  43. * @deprecated Use {@see UuidInterface::getFields()} to get a
  44. * {@see FieldsInterface} instance. If it is a
  45. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call
  46. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()}.
  47. */
  48. public function getClockSeqLowHex(): string;
  49. /**
  50. * @deprecated Use {@see UuidInterface::getFields()} to get a
  51. * {@see FieldsInterface} instance. If it is a
  52. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call
  53. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()}.
  54. */
  55. public function getClockSequenceHex(): string;
  56. /**
  57. * @deprecated In ramsey/uuid version 5.0.0, this will be removed from the
  58. * interface. It is available at {@see UuidV1::getDateTime()}.
  59. */
  60. public function getDateTime(): DateTimeInterface;
  61. /**
  62. * @deprecated This method will be removed in 5.0.0. There is no direct
  63. * alternative, but the same information may be obtained by splitting
  64. * in half the value returned by {@see UuidInterface::getHex()}.
  65. */
  66. public function getLeastSignificantBitsHex(): string;
  67. /**
  68. * @deprecated This method will be removed in 5.0.0. There is no direct
  69. * alternative, but the same information may be obtained by splitting
  70. * in half the value returned by {@see UuidInterface::getHex()}.
  71. */
  72. public function getMostSignificantBitsHex(): string;
  73. /**
  74. * @deprecated Use {@see UuidInterface::getFields()} to get a
  75. * {@see FieldsInterface} instance. If it is a
  76. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call
  77. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()}.
  78. */
  79. public function getNodeHex(): string;
  80. /**
  81. * @deprecated Use {@see UuidInterface::getFields()} to get a
  82. * {@see FieldsInterface} instance. If it is a
  83. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call
  84. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()}.
  85. */
  86. public function getTimeHiAndVersionHex(): string;
  87. /**
  88. * @deprecated Use {@see UuidInterface::getFields()} to get a
  89. * {@see FieldsInterface} instance. If it is a
  90. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call
  91. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()}.
  92. */
  93. public function getTimeLowHex(): string;
  94. /**
  95. * @deprecated Use {@see UuidInterface::getFields()} to get a
  96. * {@see FieldsInterface} instance. If it is a
  97. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call
  98. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()}.
  99. */
  100. public function getTimeMidHex(): string;
  101. /**
  102. * @deprecated Use {@see UuidInterface::getFields()} to get a
  103. * {@see FieldsInterface} instance. If it is a
  104. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call
  105. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()}.
  106. */
  107. public function getTimestampHex(): string;
  108. /**
  109. * @deprecated In ramsey/uuid version 5.0.0, this will be removed from this
  110. * interface. It has moved to {@see \Ramsey\Uuid\Rfc4122\UuidInterface::getUrn()}.
  111. */
  112. public function getUrn(): string;
  113. /**
  114. * @deprecated Use {@see UuidInterface::getFields()} to get a
  115. * {@see FieldsInterface} instance. If it is a
  116. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call
  117. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVariant()}.
  118. */
  119. public function getVariant(): ?int;
  120. /**
  121. * @deprecated Use {@see UuidInterface::getFields()} to get a
  122. * {@see FieldsInterface} instance. If it is a
  123. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call
  124. * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVersion()}.
  125. */
  126. public function getVersion(): ?int;
  127. }