PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.3.1
Defender Security – Malware Scanner, Login Security & Firewall v5.3.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / vendor / ramsey / uuid / src / UuidInterface.php

UuidInterface.php in Defender Security – Malware Scanner, Login Security & Firewall 5.3.1, at vendor/ramsey/uuid/src/UuidInterface.php

100 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 <[email protected]>
10 * @license http://opensource.org/licenses/MIT MIT
11 */
12
13 declare(strict_types=1);
14
15 namespace Ramsey\Uuid;
16
17 use JsonSerializable;
18 use Ramsey\Uuid\Fields\FieldsInterface;
19 use Ramsey\Uuid\Type\Hexadecimal;
20 use Ramsey\Uuid\Type\Integer as IntegerObject;
21 use Serializable;
22
23 /**
24 * A UUID is a universally unique identifier adhering to an agreed-upon
25 * representation format and standard for generation
26 *
27 * @psalm-immutable
28 */
29 interface UuidInterface extends
30 DeprecatedUuidInterface,
31 JsonSerializable,
32 Serializable
33 {
34 /**
35 * Returns -1, 0, or 1 if the UUID is less than, equal to, or greater than
36 * the other UUID
37 *
38 * The first of two UUIDs is greater than the second if the most
39 * significant field in which the UUIDs differ is greater for the first
40 * UUID.
41 *
42 * * Q. What's the value of being able to sort UUIDs?
43 * * A. Use them as keys in a B-Tree or similar mapping.
44 *
45 * @param UuidInterface $other The UUID to compare
46 *
47 * @return int -1, 0, or 1 if the UUID is less than, equal to, or greater than $other
48 */
49 public function compareTo(UuidInterface $other): int;
50
51 /**
52 * Returns true if the UUID is equal to the provided object
53 *
54 * The result is true if and only if the argument is not null, is a UUID
55 * object, has the same variant, and contains the same value, bit for bit,
56 * as the UUID.
57 *
58 * @param object|null $other An object to test for equality with this UUID
59 *
60 * @return bool True if the other object is equal to this UUID
61 */
62 public function equals(?object $other): bool;
63
64 /**
65 * Returns the binary string representation of the UUID
66 *
67 * @psalm-return non-empty-string
68 */
69 public function getBytes(): string;
70
71 /**
72 * Returns the fields that comprise this UUID
73 */
74 public function getFields(): FieldsInterface;
75
76 /**
77 * Returns the hexadecimal representation of the UUID
78 */
79 public function getHex(): Hexadecimal;
80
81 /**
82 * Returns the integer representation of the UUID
83 */
84 public function getInteger(): IntegerObject;
85
86 /**
87 * Returns the string standard representation of the UUID
88 *
89 * @psalm-return non-empty-string
90 */
91 public function toString(): string;
92
93 /**
94 * Casts the UUID to the string standard representation
95 *
96 * @psalm-return non-empty-string
97 */
98 public function __toString(): string;
99 }
100