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 — 3.0 ( fea5eb...c29f0e )
by Vermeulen
02:17
created

Cli::getCli()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace BFW\Core\AppSystems;
4
5
class Cli extends AbstractSystem
6
{
7
    /**
8
     * @var \BFW\Core\Cli|null $cli
9
     */
10
    protected $cli;
11
    
12
    /**
13
     * {@inheritdoc}
14
     * 
15
     * @return \BFW\Core\Cli|null
16
     */
17
    public function __invoke()
18
    {
19
        return $this->cli;
20
    }
21
22
    /**
23
     * Getter accessor to cli property
24
     * 
25
     * @return \BFW\Core\Cli|null
26
     */
27
    public function getCli()
28
    {
29
        return $this->cli;
30
    }
31
    
32
    /**
33
     * {@inheritdoc}
34
     * Define the cli property
35
     */
36
    public function init()
37
    {
38
        $this->cli        = new \BFW\Core\Cli;
39
        $this->initStatus = true;
40
    }
41
    
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function toRun()
46
    {
47
        return true;
48
    }
49
    
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function run()
54
    {
55
        $this->runCliFile();
56
        $this->runStatus = true;
57
    }
58
    
59
    /**
60
     * Run the cli file if we're in cli mode
61
     * 
62
     * @return void
63
     * 
64
     * @throws Exception If no file is specified or if the file not exist.
65
     */
66
    protected function runCliFile()
67
    {
68
        if (PHP_SAPI !== 'cli') {
69
            return;
70
        }
71
72
        \BFW\Application::getInstance()
0 ignored issues
show
Documentation Bug introduced by
The method getSubjectList does not exist on object<BFW\Application>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
73
            ->getSubjectList()
74
            ->getSubjectByName('ApplicationTasks')
75
            ->sendNotify('run_cli_file');
76
        
77
        $fileToExec = $this->cli->obtainFileFromArg();
78
        $this->cli->run($fileToExec);
79
    }
80
}
81