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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 33
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A stdout() 0 11 2
A beforeAction() 0 12 2
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
}