Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
50 | public function getId() |
||
51 | { |
||
52 | if ($this->id === null) { |
||
53 | // would require more effort if we where to massively generate / store Flows |
||
54 | $timeParts = explode(' ', microtime(false)); |
||
55 | |||
56 | return $this->id = implode('.', array_map(function ($value) { |
||
57 | return base_convert($value, 10, 36); |
||
58 | }, [ |
||
59 | $timeParts[1], |
||
60 | $timeParts[0] * 1000000, |
||
61 | ++static::$nonce, |
||
62 | mt_rand(0, 999999), |
||
63 | ])); |
||
64 | } |
||
65 | |||
66 | return $this->id; |
||
67 | } |
||
68 | } |
||
69 |