CompanyUtil::makeNewUid()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 2
nc 1
nop 1
1
<?php
2
namespace SimpleCMS\Company\Packages;
3
4
class CompanyUtil
5
{
6
    /**
7
     * 生成UID
8
     * @return string<class-string>
9
     */
10
    public static function makeNewUid(string $model): string
11
    {
12
        $maxUid = $model::max('uid') ?: 1000;
13
        return bcadd($maxUid, rand(1, 20), 0);
14
    }
15
}