Conditions | 6 |
Paths | 16 |
Total Lines | 22 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 8.304 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 3 | public static function generate(int $version = 4, $ns = null, string $name = null): UuidInterface |
|
22 | { |
||
23 | 3 | $ns = $ns ? $ns : RamseyUuid::NAMESPACE_DNS; |
|
24 | |||
25 | 3 | $name = $name ? $name : php_uname('n'); |
|
26 | |||
27 | switch ($version) { |
||
28 | 3 | case 1: |
|
29 | $uuid = RamseyUuid::uuid1(); |
||
30 | break; |
||
31 | 3 | case 3: |
|
32 | $uuid = RamseyUuid::uuid3($ns, $name); |
||
33 | break; |
||
34 | 3 | case 5: |
|
35 | $uuid = RamseyUuid::uuid5($ns, $name); |
||
36 | break; |
||
37 | default: |
||
38 | 3 | $uuid = RamseyUuid::uuid4(); |
|
39 | 3 | break; |
|
40 | } |
||
41 | |||
42 | 3 | return $uuid; |
|
43 | } |
||
68 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.