RandomIdGenerator::nextId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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