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.

Nip_Tool::mainMenu()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 10
ccs 0
cts 4
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
class Nip_Tool
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
6
    protected $_console;
7
    protected $_generator;
8
    protected $_menus = [];
9
10
    /**
11
     * @return Nip_Tool_Generator
12
     */
13
    public function getGenerator()
14
    {
15
        if (!$this->_generator) {
16
            $this->_generator = new Nip_Tool_Generator();
17
            $this->_generator->setTool($this);
18
        }
19
        return $this->_generator;
20
    }
21
22
    public function bootstrap()
23
    {
24
    }
25
26
    public function run()
27
    {
28
        $this->intro();
29
        return $this->mainMenu();
30
    }
31
32
    public function intro()
33
    {
34
        $this->getConsole()->output("***************************
35
***       Nip Tool      ***
36
***************************
37
");
38
    }
39
40
    /**
41
     * @return Nip_Tool_Console
42
     */
43
    public function getConsole()
44
    {
45
        if (!$this->_console) {
46
            $this->_console = new Nip_Tool_Console();
47
        }
48
49
        return $this->_console;
50
    }
51
52
    public function mainMenu()
53
    {
54
        $response = $this->getConsole()->askVariant('How can i serve you today master ?', array(
55
                'model'     => 'Models',
56
                'module'    => 'Module',
57
                'controller' => 'Controller',
58
                'exit' => 'Exit',
59
            ));
60
        return $this->runMenu($response);
61
    }
62
63
    /**
64
     * @return Nip_Tool_Menu_Abstract
65
     */
66
    public function runMenu($name)
67
    {
68
        return $this->getMenu($name)->main();
69
    }
70
71
    /**
72
     * @return Nip_Tool_Menu_Abstract
73
     */
74
    public function getMenu($name)
75
    {
76
        if (!$this->_menus[$name]) {
77
            $class = 'Nip_Tool_Menu_'.ucfirst($name);
78
            $this->_menus[$name] = new $class();
79
            $this->_menus[$name]->setTool($this);
80
        }
81
82
        return $this->_menus[$name];
83
    }
84
85
}