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 ➔ wait()   B

Complexity

Conditions 6
Paths 6

Size

Total Lines 21
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 1
Metric Value
cc 6
eloc 11
c 3
b 1
f 1
nc 6
nop 2
dl 0
loc 21
rs 8.7624
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