GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( df6192...9ae1b6 )
by Simon
05:50
created

helpers.php ➔ uuid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
if (!function_exists('wait')) {
3
    /**
4
     * Block execution until a command has finished been projected/dispatched
5
     * @param \SmoothPhp\Contracts\CommandBus\Command[]|\SmoothPhp\Contracts\CommandBus\Command $commands
6
     * @param int $timeout Timeout 8 seconds
7
     */
8
    function wait($commands, $timeout = 8)
9
    {
10
        if (config('app.env') == 'testing') {
11
            return;
12
        }
13
14
        if (!is_array($commands)) {
15
            return wait([$commands], $timeout);
16
        }
17
18
        $limit = time() + $timeout;
19
        foreach ($commands as $command) {
20
            while (!Cache::has((string)$command)) {
21
                usleep(1000);
22
23
                if (time() > $limit) {
24
                    return;
25
                }
26
            }
27
        }
28
    }
29
}
30
if (!function_exists('uuid')) {
31
    /**
32
     * Generate a UUID string
33
     * @return string
34
     */
35
    function uuid()
36
    {
37
        return (string)\Ramsey\Uuid\Uuid::uuid4();
38
    }
39
}
40