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.

Index   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 6 1
A running() 0 22 2
1
<?php
2
3
namespace App\CLI;
4
5
/**
6
 * Index CLI Class.
7
 *
8
 * @author Vijay Mahrra <[email protected]>
9
 * @copyright (c) Copyright 2015 Vijay Mahrra
10
 * @license GPLv3 (http://www.gnu.org/licenses/gpl-3.0.html)
11
 */
12
class Index extends Base
13
{
14
    /**
15
     * @return void
16
     */
17
    public function index()
18
    {
19
        $cli = $this->cli;
20
        $cli->shoutBold(__METHOD__);
21
        $cli->shout('Hello World!');
22
    }
23
24
    /**
25
     * example to test if already running
26
     * run cli.php '/index/running' in two different terminals
27
     *
28
     * @return false|null
29
     */
30
    public function running()
31
    {
32
        $cli = $this->cli;
33
        $cli->shoutBold(__METHOD__);
34
35
        // use process id for log notifications
36
        $mypid = getmypid();
37
        $pid   = $mypid['PID'];
38
        $msg   = $pid . ': Starting...';
39
        $cli->shout($msg);
40
41
        // check if already running, quit if so
42
        exec('ps auxww | grep -i index/running | grep -v grep', $output);
43
44
        if (1 < count($output)) {
45
            $msg = $pid . ': Already running! Quitting.';
46
            $cli->shout($msg);
47
            return false;
48
        }
49
50
        sleep(10);
51
    }
52
}
53