← All changes
|
includes/sdk/google/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php
+104
-144
1.2.8
→
1.4.2
View file →
| @@ -9,112 +9,94 @@ | ||
| 9 | 9 | * @copyright Copyright (c) Ben Ramsey <[email protected]> |
| 10 | 10 | * @license http://opensource.org/licenses/MIT MIT |
| 11 | 11 | */ |
| 12 | 12 | declare (strict_types=1); |
| 13 | -namespace Dudlewebs\WPMCS\Ramsey\Uuid; | |
| 13 | +namespace Dudlewebs\WPMCS\GCP\Ramsey\Uuid; | |
| 14 | 14 | |
| 15 | 15 | use DateTimeImmutable; |
| 16 | 16 | use DateTimeInterface; |
| 17 | -use Dudlewebs\WPMCS\Ramsey\Uuid\Converter\NumberConverterInterface; | |
| 18 | -use Dudlewebs\WPMCS\Ramsey\Uuid\Converter\TimeConverterInterface; | |
| 19 | -use Dudlewebs\WPMCS\Ramsey\Uuid\Exception\DateTimeException; | |
| 20 | -use Dudlewebs\WPMCS\Ramsey\Uuid\Exception\UnsupportedOperationException; | |
| 21 | -use Dudlewebs\WPMCS\Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; | |
| 17 | +use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Converter\NumberConverterInterface; | |
| 18 | +use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Exception\DateTimeException; | |
| 19 | +use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Exception\UnsupportedOperationException; | |
| 22 | 20 | use Throwable; |
| 23 | 21 | use function str_pad; |
| 24 | 22 | use function substr; |
| 25 | 23 | use const STR_PAD_LEFT; |
| 26 | 24 | /** |
| 27 | - * This trait encapsulates deprecated methods for ramsey/uuid; this trait and | |
| 28 | - * its methods will be removed in ramsey/uuid 5.0.0. | |
| 25 | + * This trait encapsulates deprecated methods for ramsey/uuid; this trait and its methods will be removed in ramsey/uuid 5.0.0. | |
| 29 | 26 | * |
| 30 | - * @psalm-immutable | |
| 27 | + * @deprecated This trait and its methods will be removed in ramsey/uuid 5.0.0. | |
| 28 | + * | |
| 29 | + * @immutable | |
| 31 | 30 | */ |
| 32 | 31 | trait DeprecatedUuidMethodsTrait |
| 33 | 32 | { |
| 34 | 33 | /** |
| 35 | - * @var Rfc4122FieldsInterface | |
| 34 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 35 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 36 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()} and use the arbitrary-precision math | |
| 37 | + * library of your choice to convert it to a string integer. | |
| 36 | 38 | */ |
| 37 | - protected $fields; | |
| 38 | - /** | |
| 39 | - * @var NumberConverterInterface | |
| 40 | - */ | |
| 41 | - protected $numberConverter; | |
| 42 | - /** | |
| 43 | - * @var TimeConverterInterface | |
| 44 | - */ | |
| 45 | - protected $timeConverter; | |
| 46 | - /** | |
| 47 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 48 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 49 | - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqHiAndReserved()} | |
| 50 | - * and use the arbitrary-precision math library of your choice to | |
| 51 | - * convert it to a string integer. | |
| 52 | - */ | |
| 53 | - public function getClockSeqHiAndReserved(): string | |
| 39 | + public function getClockSeqHiAndReserved() : string | |
| 54 | 40 | { |
| 55 | 41 | return $this->numberConverter->fromHex($this->fields->getClockSeqHiAndReserved()->toString()); |
| 56 | 42 | } |
| 57 | 43 | /** |
| 58 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 59 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 60 | - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqHiAndReserved()}. | |
| 44 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 45 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 46 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()}. | |
| 61 | 47 | */ |
| 62 | - public function getClockSeqHiAndReservedHex(): string | |
| 48 | + public function getClockSeqHiAndReservedHex() : string | |
| 63 | 49 | { |
| 64 | 50 | return $this->fields->getClockSeqHiAndReserved()->toString(); |
| 65 | 51 | } |
| 66 | 52 | /** |
| 67 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 68 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 69 | - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqLow()} | |
| 70 | - * and use the arbitrary-precision math library of your choice to | |
| 71 | - * convert it to a string integer. | |
| 53 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 54 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 55 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()} and use the arbitrary-precision math library of | |
| 56 | + * your choice to convert it to a string integer. | |
| 72 | 57 | */ |
| 73 | - public function getClockSeqLow(): string | |
| 58 | + public function getClockSeqLow() : string | |
| 74 | 59 | { |
| 75 | 60 | return $this->numberConverter->fromHex($this->fields->getClockSeqLow()->toString()); |
| 76 | 61 | } |
| 77 | 62 | /** |
| 78 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 79 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 80 | - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqLow()}. | |
| 63 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 64 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 65 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()}. | |
| 81 | 66 | */ |
| 82 | - public function getClockSeqLowHex(): string | |
| 67 | + public function getClockSeqLowHex() : string | |
| 83 | 68 | { |
| 84 | 69 | return $this->fields->getClockSeqLow()->toString(); |
| 85 | 70 | } |
| 86 | 71 | /** |
| 87 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 88 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 89 | - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeq()} | |
| 90 | - * and use the arbitrary-precision math library of your choice to | |
| 91 | - * convert it to a string integer. | |
| 72 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 73 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 74 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()} and use the arbitrary-precision math library of | |
| 75 | + * your choice to convert it to a string integer. | |
| 92 | 76 | */ |
| 93 | - public function getClockSequence(): string | |
| 77 | + public function getClockSequence() : string | |
| 94 | 78 | { |
| 95 | 79 | return $this->numberConverter->fromHex($this->fields->getClockSeq()->toString()); |
| 96 | 80 | } |
| 97 | 81 | /** |
| 98 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 99 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 100 | - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeq()}. | |
| 82 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 83 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 84 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()}. | |
| 101 | 85 | */ |
| 102 | - public function getClockSequenceHex(): string | |
| 86 | + public function getClockSequenceHex() : string | |
| 103 | 87 | { |
| 104 | 88 | return $this->fields->getClockSeq()->toString(); |
| 105 | 89 | } |
| 106 | 90 | /** |
| 107 | - * @deprecated This method will be removed in 5.0.0. There is no alternative | |
| 108 | - * recommendation, so plan accordingly. | |
| 91 | + * @deprecated This method will be removed in 5.0.0. There is no alternative recommendation, so plan accordingly. | |
| 109 | 92 | */ |
| 110 | - public function getNumberConverter(): NumberConverterInterface | |
| 93 | + public function getNumberConverter() : NumberConverterInterface | |
| 111 | 94 | { |
| 112 | 95 | return $this->numberConverter; |
| 113 | 96 | } |
| 114 | 97 | /** |
| 115 | - * @deprecated In ramsey/uuid version 5.0.0, this will be removed. | |
| 116 | - * It is available at {@see UuidV1::getDateTime()}. | |
| 98 | + * @deprecated In ramsey/uuid version 5.0.0, this will be removed. It is available at {@see UuidV1::getDateTime()}. | |
| 117 | 99 | * |
| 118 | 100 | * @return DateTimeImmutable An immutable instance of DateTimeInterface |
| 119 | 101 | * |
| 120 | 102 | * @throws UnsupportedOperationException if UUID is not time-based |
| @@ -119,9 +101,9 @@ | ||
| 119 | 101 | * |
| 120 | 102 | * @throws UnsupportedOperationException if UUID is not time-based |
| 121 | 103 | * @throws DateTimeException if DateTime throws an exception/error |
| 122 | 104 | */ |
| 123 | - public function getDateTime(): DateTimeInterface | |
| 105 | + public function getDateTime() : DateTimeInterface | |
| 124 | 106 | { |
| 125 | 107 | if ($this->fields->getVersion() !== 1) { |
| 126 | 108 | throw new UnsupportedOperationException('Not a time-based UUID'); |
| 127 | 109 | } |
| @@ -132,143 +114,133 @@ | ||
| 132 | 114 | throw new DateTimeException($e->getMessage(), (int) $e->getCode(), $e); |
| 133 | 115 | } |
| 134 | 116 | } |
| 135 | 117 | /** |
| 136 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 137 | - * {@see FieldsInterface} instance. | |
| 118 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 138 | 119 | * |
| 139 | 120 | * @return string[] |
| 140 | 121 | */ |
| 141 | - public function getFieldsHex(): array | |
| 122 | + public function getFieldsHex() : array | |
| 142 | 123 | { |
| 143 | 124 | return ['time_low' => $this->fields->getTimeLow()->toString(), 'time_mid' => $this->fields->getTimeMid()->toString(), 'time_hi_and_version' => $this->fields->getTimeHiAndVersion()->toString(), 'clock_seq_hi_and_reserved' => $this->fields->getClockSeqHiAndReserved()->toString(), 'clock_seq_low' => $this->fields->getClockSeqLow()->toString(), 'node' => $this->fields->getNode()->toString()]; |
| 144 | 125 | } |
| 145 | 126 | /** |
| 146 | - * @deprecated This method will be removed in 5.0.0. There is no direct | |
| 147 | - * alternative, but the same information may be obtained by splitting | |
| 148 | - * in half the value returned by {@see UuidInterface::getHex()}. | |
| 127 | + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be | |
| 128 | + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. | |
| 149 | 129 | */ |
| 150 | - public function getLeastSignificantBits(): string | |
| 130 | + public function getLeastSignificantBits() : string | |
| 151 | 131 | { |
| 152 | 132 | $leastSignificantHex = substr($this->getHex()->toString(), 16); |
| 153 | 133 | return $this->numberConverter->fromHex($leastSignificantHex); |
| 154 | 134 | } |
| 155 | 135 | /** |
| 156 | - * @deprecated This method will be removed in 5.0.0. There is no direct | |
| 157 | - * alternative, but the same information may be obtained by splitting | |
| 158 | - * in half the value returned by {@see UuidInterface::getHex()}. | |
| 136 | + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be | |
| 137 | + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. | |
| 159 | 138 | */ |
| 160 | - public function getLeastSignificantBitsHex(): string | |
| 139 | + public function getLeastSignificantBitsHex() : string | |
| 161 | 140 | { |
| 162 | 141 | return substr($this->getHex()->toString(), 16); |
| 163 | 142 | } |
| 164 | 143 | /** |
| 165 | - * @deprecated This method will be removed in 5.0.0. There is no direct | |
| 166 | - * alternative, but the same information may be obtained by splitting | |
| 167 | - * in half the value returned by {@see UuidInterface::getHex()}. | |
| 144 | + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be | |
| 145 | + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. | |
| 168 | 146 | */ |
| 169 | - public function getMostSignificantBits(): string | |
| 147 | + public function getMostSignificantBits() : string | |
| 170 | 148 | { |
| 171 | 149 | $mostSignificantHex = substr($this->getHex()->toString(), 0, 16); |
| 172 | 150 | return $this->numberConverter->fromHex($mostSignificantHex); |
| 173 | 151 | } |
| 174 | 152 | /** |
| 175 | - * @deprecated This method will be removed in 5.0.0. There is no direct | |
| 176 | - * alternative, but the same information may be obtained by splitting | |
| 177 | - * in half the value returned by {@see UuidInterface::getHex()}. | |
| 153 | + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be | |
| 154 | + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. | |
| 178 | 155 | */ |
| 179 | - public function getMostSignificantBitsHex(): string | |
| 156 | + public function getMostSignificantBitsHex() : string | |
| 180 | 157 | { |
| 181 | 158 | return substr($this->getHex()->toString(), 0, 16); |
| 182 | 159 | } |
| 183 | 160 | /** |
| 184 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 185 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 186 | - * instance, you may call {@see Rfc4122FieldsInterface::getNode()} | |
| 187 | - * and use the arbitrary-precision math library of your choice to | |
| 188 | - * convert it to a string integer. | |
| 161 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 162 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 163 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()} and use the arbitrary-precision math library of your | |
| 164 | + * choice to convert it to a string integer. | |
| 189 | 165 | */ |
| 190 | - public function getNode(): string | |
| 166 | + public function getNode() : string | |
| 191 | 167 | { |
| 192 | 168 | return $this->numberConverter->fromHex($this->fields->getNode()->toString()); |
| 193 | 169 | } |
| 194 | 170 | /** |
| 195 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 196 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 197 | - * instance, you may call {@see Rfc4122FieldsInterface::getNode()}. | |
| 171 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 172 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 173 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()}. | |
| 198 | 174 | */ |
| 199 | - public function getNodeHex(): string | |
| 175 | + public function getNodeHex() : string | |
| 200 | 176 | { |
| 201 | 177 | return $this->fields->getNode()->toString(); |
| 202 | 178 | } |
| 203 | 179 | /** |
| 204 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 205 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 206 | - * instance, you may call {@see Rfc4122FieldsInterface::getTimeHiAndVersion()} | |
| 207 | - * and use the arbitrary-precision math library of your choice to | |
| 208 | - * convert it to a string integer. | |
| 180 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 181 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 182 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()} and use the arbitrary-precision math | |
| 183 | + * library of your choice to convert it to a string integer. | |
| 209 | 184 | */ |
| 210 | - public function getTimeHiAndVersion(): string | |
| 185 | + public function getTimeHiAndVersion() : string | |
| 211 | 186 | { |
| 212 | 187 | return $this->numberConverter->fromHex($this->fields->getTimeHiAndVersion()->toString()); |
| 213 | 188 | } |
| 214 | 189 | /** |
| 215 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 216 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 217 | - * instance, you may call {@see Rfc4122FieldsInterface::getTimeHiAndVersion()}. | |
| 190 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 191 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 192 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()}. | |
| 218 | 193 | */ |
| 219 | - public function getTimeHiAndVersionHex(): string | |
| 194 | + public function getTimeHiAndVersionHex() : string | |
| 220 | 195 | { |
| 221 | 196 | return $this->fields->getTimeHiAndVersion()->toString(); |
| 222 | 197 | } |
| 223 | 198 | /** |
| 224 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 225 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 226 | - * instance, you may call {@see Rfc4122FieldsInterface::getTimeLow()} | |
| 227 | - * and use the arbitrary-precision math library of your choice to | |
| 228 | - * convert it to a string integer. | |
| 199 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 200 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 201 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()} and use the arbitrary-precision math library of | |
| 202 | + * your choice to convert it to a string integer. | |
| 229 | 203 | */ |
| 230 | - public function getTimeLow(): string | |
| 204 | + public function getTimeLow() : string | |
| 231 | 205 | { |
| 232 | 206 | return $this->numberConverter->fromHex($this->fields->getTimeLow()->toString()); |
| 233 | 207 | } |
| 234 | 208 | /** |
| 235 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 236 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 237 | - * instance, you may call {@see Rfc4122FieldsInterface::getTimeLow()}. | |
| 209 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 210 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 211 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()}. | |
| 238 | 212 | */ |
| 239 | - public function getTimeLowHex(): string | |
| 213 | + public function getTimeLowHex() : string | |
| 240 | 214 | { |
| 241 | 215 | return $this->fields->getTimeLow()->toString(); |
| 242 | 216 | } |
| 243 | 217 | /** |
| 244 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 245 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 246 | - * instance, you may call {@see Rfc4122FieldsInterface::getTimeMid()} | |
| 247 | - * and use the arbitrary-precision math library of your choice to | |
| 248 | - * convert it to a string integer. | |
| 218 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 219 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 220 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()} and use the arbitrary-precision math library of | |
| 221 | + * your choice to convert it to a string integer. | |
| 249 | 222 | */ |
| 250 | - public function getTimeMid(): string | |
| 223 | + public function getTimeMid() : string | |
| 251 | 224 | { |
| 252 | 225 | return $this->numberConverter->fromHex($this->fields->getTimeMid()->toString()); |
| 253 | 226 | } |
| 254 | 227 | /** |
| 255 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 256 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 257 | - * instance, you may call {@see Rfc4122FieldsInterface::getTimeMid()}. | |
| 228 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 229 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 230 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()}. | |
| 258 | 231 | */ |
| 259 | - public function getTimeMidHex(): string | |
| 232 | + public function getTimeMidHex() : string | |
| 260 | 233 | { |
| 261 | 234 | return $this->fields->getTimeMid()->toString(); |
| 262 | 235 | } |
| 263 | 236 | /** |
| 264 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 265 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 266 | - * instance, you may call {@see Rfc4122FieldsInterface::getTimestamp()} | |
| 267 | - * and use the arbitrary-precision math library of your choice to | |
| 268 | - * convert it to a string integer. | |
| 237 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 238 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 239 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()} and use the arbitrary-precision math library of | |
| 240 | + * your choice to convert it to a string integer. | |
| 269 | 241 | */ |
| 270 | - public function getTimestamp(): string | |
| 242 | + public function getTimestamp() : string | |
| 271 | 243 | { |
| 272 | 244 | if ($this->fields->getVersion() !== 1) { |
| 273 | 245 | throw new UnsupportedOperationException('Not a time-based UUID'); |
| 274 | 246 | } |
| @@ -274,13 +246,13 @@ | ||
| 274 | 246 | } |
| 275 | 247 | return $this->numberConverter->fromHex($this->fields->getTimestamp()->toString()); |
| 276 | 248 | } |
| 277 | 249 | /** |
| 278 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 279 | - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} | |
| 280 | - * instance, you may call {@see Rfc4122FieldsInterface::getTimestamp()}. | |
| 250 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 251 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 252 | + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()}. | |
| 281 | 253 | */ |
| 282 | - public function getTimestampHex(): string | |
| 254 | + public function getTimestampHex() : string | |
| 283 | 255 | { |
| 284 | 256 | if ($this->fields->getVersion() !== 1) { |
| 285 | 257 | throw new UnsupportedOperationException('Not a time-based UUID'); |
| 286 | 258 | } |
| @@ -286,34 +258,22 @@ | ||
| 286 | 258 | } |
| 287 | 259 | return $this->fields->getTimestamp()->toString(); |
| 288 | 260 | } |
| 289 | 261 | /** |
| 290 | - * @deprecated This has moved to {@see Rfc4122FieldsInterface::getUrn()} and | |
| 291 | - * is available on {@see \Ramsey\Uuid\Rfc4122\UuidV1}, | |
| 292 | - * {@see \Ramsey\Uuid\Rfc4122\UuidV3}, {@see \Ramsey\Uuid\Rfc4122\UuidV4}, | |
| 293 | - * and {@see \Ramsey\Uuid\Rfc4122\UuidV5}. | |
| 294 | - */ | |
| 295 | - public function getUrn(): string | |
| 296 | - { | |
| 297 | - return 'urn:uuid:' . $this->toString(); | |
| 298 | - } | |
| 299 | - /** | |
| 300 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 301 | - * {@see FieldsInterface} instance. If it is a | |
| 302 | - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 262 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 263 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 303 | 264 | * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVariant()}. |
| 304 | 265 | */ |
| 305 | - public function getVariant(): ?int | |
| 266 | + public function getVariant() : ?int | |
| 306 | 267 | { |
| 307 | 268 | return $this->fields->getVariant(); |
| 308 | 269 | } |
| 309 | 270 | /** |
| 310 | - * @deprecated Use {@see UuidInterface::getFields()} to get a | |
| 311 | - * {@see FieldsInterface} instance. If it is a | |
| 312 | - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 271 | + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. | |
| 272 | + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call | |
| 313 | 273 | * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVersion()}. |
| 314 | 274 | */ |
| 315 | - public function getVersion(): ?int | |
| 275 | + public function getVersion() : ?int | |
| 316 | 276 | { |
| 317 | 277 | return $this->fields->getVersion(); |
| 318 | 278 | } |
| 319 | 279 | } |