1 | <?php |
||
17 | class SequentialGenerator implements UuidGenerator |
||
18 | { |
||
19 | /** |
||
20 | * @var int |
||
21 | */ |
||
22 | private $counter; |
||
23 | |||
24 | /** |
||
25 | * @var int |
||
26 | */ |
||
27 | private $head; |
||
28 | |||
29 | /** |
||
30 | * @example $mark = 15 and $start = 10 will generate: |
||
31 | * '00000000-0000-000f-0000-00000000000a' |
||
32 | * '00000000-0000-000f-0000-00000000000b' |
||
33 | * '00000000-0000-000f-0000-00000000000c' |
||
34 | * ... |
||
35 | */ |
||
36 | 3 | public function __construct(int $mark = 0, int $start = 0) |
|
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 3 | public function generate(string $name = null): Uuid |
|
49 | } |
||
50 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.