Id   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A make() 0 11 3
1
<?php
2
3
/*
4
 * This file is part of Laravel Sense.
5
 *
6
 * (c) Anton Komarev <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Cog\Laravel\Sense\Request;
15
16
use Illuminate\Support\Facades\Log;
17
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
18
use Ramsey\Uuid\Uuid;
19
use Throwable;
20
21
final class Id
22
{
23
    public static function make(): string
24
    {
25
        try {
26
            return Uuid::uuid4()->toString();
27
        } catch (UnsatisfiedDependencyException $exception) {
28
            Log::critical('Caught exception: ' . $exception->getMessage() . "\n");
29
        } catch (Throwable $exception) {
30
            Log::critical('Caught exception: ' . $exception->getMessage() . "\n");
31
        }
32
33
        return '';
34
    }
35
}
36