PluginProbe
Media Cloud Sync / 1.2.7
Media Cloud Sync v1.2.7
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 / VersionTrait.php

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

52 lines 1.2 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\Ramsey\Uuid\Rfc4122;
14
15 /**
16 * Provides common functionality for handling the version, as defined by RFC 4122
17 *
18 * @psalm-immutable
19 */
20 trait VersionTrait
21 {
22 /**
23 * Returns the version
24 */
25 abstract public function getVersion(): ?int;
26 /**
27 * Returns true if these fields represent a nil UUID
28 */
29 abstract public function isNil(): bool;
30 /**
31 * Returns true if the version matches one of those defined by RFC 4122
32 *
33 * @return bool True if the UUID version is valid, false otherwise
34 */
35 private function isCorrectVersion(): bool
36 {
37 if ($this->isNil()) {
38 return \true;
39 }
40 switch ($this->getVersion()) {
41 case 1:
42 case 2:
43 case 3:
44 case 4:
45 case 5:
46 case 6:
47 return \true;
48 }
49 return \false;
50 }
51 }
52