| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* This file is part of the ramsey/uuid library |
| 5 |
* |
| 6 |
* For the full copyright and license information, please view the LICENSE |
| 7 |
* file that was distributed with this source code. |
| 8 |
* |
| 9 |
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com> |
| 10 |
* @license http://opensource.org/licenses/MIT MIT |
| 11 |
*/ |
| 12 |
declare (strict_types=1); |
| 13 |
namespace Dudlewebs\WPMCS\GCP\Ramsey\Uuid; |
| 14 |
|
| 15 |
use JsonSerializable; |
| 16 |
use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Fields\FieldsInterface; |
| 17 |
use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Type\Hexadecimal; |
| 18 |
use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Type\Integer as IntegerObject; |
| 19 |
use Serializable; |
| 20 |
use Stringable; |
| 21 |
/** |
| 22 |
* A UUID is a universally unique identifier adhering to an agreed-upon representation format and standard for generation |
| 23 |
* |
| 24 |
* @immutable |
| 25 |
*/ |
| 26 |
interface UuidInterface extends DeprecatedUuidInterface, JsonSerializable, Serializable, Stringable |
| 27 |
{ |
| 28 |
/** |
| 29 |
* Returns -1, 0, or 1 if the UUID is less than, equal to, or greater than the other UUID |
| 30 |
* |
| 31 |
* The first of two UUIDs is greater than the second if the most significant field in which the UUIDs differ is |
| 32 |
* greater for the first UUID. |
| 33 |
* |
| 34 |
* @param UuidInterface $other The UUID to compare |
| 35 |
* |
| 36 |
* @return int<-1,1> -1, 0, or 1 if the UUID is less than, equal to, or greater than $other |
| 37 |
*/ |
| 38 |
public function compareTo(UuidInterface $other) : int; |
| 39 |
/** |
| 40 |
* Returns true if the UUID is equal to the provided object |
| 41 |
* |
| 42 |
* The result is true if and only if the argument is not null, is a UUID object, has the same variant, and contains |
| 43 |
* the same value, bit-for-bit, as the UUID. |
| 44 |
* |
| 45 |
* @param object | null $other An object to test for equality with this UUID |
| 46 |
* |
| 47 |
* @return bool True if the other object is equal to this UUID |
| 48 |
*/ |
| 49 |
public function equals(?object $other) : bool; |
| 50 |
/** |
| 51 |
* Returns the binary string representation of the UUID |
| 52 |
* |
| 53 |
* @return non-empty-string |
| 54 |
* |
| 55 |
* @pure |
| 56 |
*/ |
| 57 |
public function getBytes() : string; |
| 58 |
/** |
| 59 |
* Returns the fields that comprise this UUID |
| 60 |
*/ |
| 61 |
public function getFields() : FieldsInterface; |
| 62 |
/** |
| 63 |
* Returns the hexadecimal representation of the UUID |
| 64 |
*/ |
| 65 |
public function getHex() : Hexadecimal; |
| 66 |
/** |
| 67 |
* Returns the integer representation of the UUID |
| 68 |
*/ |
| 69 |
public function getInteger() : IntegerObject; |
| 70 |
/** |
| 71 |
* Returns the string standard representation of the UUID as a URN |
| 72 |
* |
| 73 |
* @link http://en.wikipedia.org/wiki/Uniform_Resource_Name Uniform Resource Name |
| 74 |
* @link https://www.rfc-editor.org/rfc/rfc9562.html#section-4 RFC 9562, 4. UUID Format |
| 75 |
* @link https://www.rfc-editor.org/rfc/rfc9562.html#section-7 RFC 9562, 7. IANA Considerations |
| 76 |
* @link https://www.rfc-editor.org/rfc/rfc4122.html#section-3 RFC 4122, 3. Namespace Registration Template |
| 77 |
*/ |
| 78 |
public function getUrn() : string; |
| 79 |
/** |
| 80 |
* Returns the string standard representation of the UUID |
| 81 |
* |
| 82 |
* @return non-empty-string |
| 83 |
* |
| 84 |
* @pure |
| 85 |
*/ |
| 86 |
public function toString() : string; |
| 87 |
/** |
| 88 |
* Casts the UUID to the string standard representation |
| 89 |
* |
| 90 |
* @return non-empty-string |
| 91 |
* |
| 92 |
* @pure |
| 93 |
*/ |
| 94 |
public function __toString() : string; |
| 95 |
} |
| 96 |
|