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 ( d0c102...8ca686 )
by Sam
02:40
created

MigrateController::stdout()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 2
eloc 7
nc 2
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SamIT\Yii2\PhpFpm\controllers;
5
6
7
use Docker\API\Model\BuildInfo;
8
use Docker\Context\Context;
9
use Docker\Context\ContextBuilder;
10
use Docker\Docker;
11
use Docker\Stream\BuildStream;
12
use SamIT\Yii2\PhpFpm\Module;
13
use yii\console\Controller;
14
use yii\helpers\Console;
15
16
/**
17
 * Class MigrateController
18
 * @package SamIT\Yii2\PhpFpm\controllers
19
 * @property Module $module
20
 */
21
class MigrateController extends \yii\console\controllers\MigrateController
22
{
23
24
    public function stdout($string)
25
    {
26
        if ($this->isColorEnabled()) {
27
            $args = \func_get_args();
28
            \array_shift($args);
29
            $string = Console::ansiFormat($string, $args);
30
        }
31
32
        echo $string;
33
        return \strlen($string);
34
    }
35
36
    public function beforeAction($action)
37
    {
38
        // Obtain lock.
39
        $this->stdout('Waiting for lock...', Console::FG_CYAN);
40
        if ($this->module->getLock()) {
41
            $this->stdout("OK\n", Console::FG_GREEN);
42
        } else {
43
            $this->stdout("FAIL\n", Console::FG_RED);
44
            return false;
45
        }
46
        return parent::beforeAction($action);
47
    }
48
49
50
51
52
53
}