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 ( bbf2ff...d7ffda )
by Robert
12:47
created

RetryAcquireTrait::retryAcquire()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 7
cts 7
cp 1
rs 9.8666
c 0
b 0
f 0
cc 3
nc 2
nop 2
crap 3
1
<?php
2
/**
3
 * @link http://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license http://www.yiiframework.com/license/
6
 */
7
8
namespace yii\mutex;
9
10
use Closure;
11
12
/**
13
 * Trait RetryAcquireTrait.
14
 *
15
 * @author Robert Korulczyk <[email protected]>
16
 * @internal
17
 */
18
trait RetryAcquireTrait
19
{
20
    /**
21
     * @var int Number of milliseconds between each try in [[acquire()]] until specified timeout times out.
22
     * By default it is 50 milliseconds - it means that [[acquire()]] may try acquire lock up to 20 times per second.
23
     * @since 2.0.16
24
     */
25
    public $retryDelay = 50;
26
27
28 24
    private function retryAcquire($timeout, Closure $callback)
29
    {
30 24
        $start = microtime(true);
31
        do {
32 24
            if ($callback()) {
33 24
                return true;
34
            }
35 9
            usleep($this->retryDelay * 1000);
36 9
        } while (microtime(true) - $start < $timeout);
37
38 9
        return false;
39
    }
40
}
41