PluginProbe
Media Cloud Sync / 1.4.2
Media Cloud Sync v1.4.2
1.4.2 1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 All 36 releases
media-cloud-sync / includes / sdk / google / ramsey / uuid / src / Rfc4122 / UuidV4.php

UuidV4.php in Media Cloud Sync 1.4.2, at includes/sdk/google/ramsey/uuid/src/Rfc4122/UuidV4.php

47 lines 2.0 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 declare (strict_types=1);
13 namespace Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Rfc4122;
14
15 use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Codec\CodecInterface;
16 use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Converter\NumberConverterInterface;
17 use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Converter\TimeConverterInterface;
18 use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Exception\InvalidArgumentException;
19 use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface;
20 use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Uuid;
21 /**
22 * Random, or version 4, UUIDs are randomly or pseudo-randomly generated 128-bit integers
23 *
24 * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.4 RFC 9562, 5.4. UUID Version 4
25 *
26 * @immutable
27 */
28 final class UuidV4 extends Uuid implements UuidInterface
29 {
30 /**
31 * Creates a version 4 (random) UUID
32 *
33 * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID
34 * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers
35 * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings
36 * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a
37 * UUID to unix timestamps
38 */
39 public function __construct(Rfc4122FieldsInterface $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, TimeConverterInterface $timeConverter)
40 {
41 if ($fields->getVersion() !== Uuid::UUID_TYPE_RANDOM) {
42 throw new InvalidArgumentException('Fields used to create a UuidV4 must represent a version 4 (random) UUID');
43 }
44 parent::__construct($fields, $numberConverter, $codec, $timeConverter);
45 }
46 }
47