CompanyUtil   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A makeNewUid() 0 4 2
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
}