RandomIdGenerator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 13
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A nextId() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Nastoletni\Code\Application\Generator;
6
7
use Nastoletni\Code\Domain\Paste;
8
9
class RandomIdGenerator
10
{
11
    /**
12
     * Returns cryptographically unique Id consisting of five digits.
13
     *
14
     * @return Paste\Id
15
     */
16 5
    public static function nextId(): Paste\Id
17
    {
18
        //                                           10000     ZZZZZ
19 5
        return Paste\Id::createFromBase10(random_int(14776336, 916132831));
20
    }
21
}
22