Conditions | 6 |
Paths | 16 |
Total Lines | 22 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
22 | 5 | public static function generateUuid(int $version = 4, $ns = null, string $name = null): UuidInterface |
|
23 | { |
||
24 | 5 | $ns = $ns ? $ns : Uuid::NAMESPACE_DNS; |
|
25 | |||
26 | 5 | $name = $name ? $name : php_uname('n'); |
|
27 | |||
28 | switch ($version) { |
||
29 | 5 | case 1: |
|
30 | 1 | $uuid = Uuid::uuid1(); |
|
31 | 1 | break; |
|
32 | 5 | case 3: |
|
33 | 1 | $uuid = Uuid::uuid3($ns, $name); |
|
34 | 1 | break; |
|
35 | 5 | case 5: |
|
36 | 1 | $uuid = Uuid::uuid5($ns, $name); |
|
37 | 1 | break; |
|
38 | default: |
||
39 | 5 | $uuid = Uuid::uuid4(); |
|
40 | 5 | break; |
|
41 | } |
||
42 | |||
43 | 5 | return $uuid; |
|
44 | } |
||
67 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.