Passed
Push — master ( d2ad69...686350 )
by Kacper
02:44
created

Console::_style()   B

Complexity

Conditions 13
Paths 13

Size

Total Lines 20
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 182

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 20
ccs 0
cts 16
cp 0
rs 7.3977
cc 13
eloc 17
nc 13
nop 2
crap 182

How to fix   Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * Highlighter
4
 *
5
 * Copyright (C) 2015, Some right reserved.
6
 *
7
 * @author Kacper "Kadet" Donat <[email protected]>
8
 *
9
 * Contact with author:
10
 * Xmpp: [email protected]
11
 * E-mail: [email protected]
12
 *
13
 * From Kadet with love.
14
 */
15
16
namespace Kadet\Highlighter\Utils;
17
18
19
class Console
20
{
21
    /**
22
     * @var ConsoleHelper
23
     */
24
    private static $_instance;
25
26
    /**
27
     * @return ConsoleHelper
28
     */
29 4
    public static function get() {
30 4
        if(!isset(self::$_instance)) {
31 1
            self::$_instance = new ConsoleHelper();
32 1
        }
33
34 4
        return self::$_instance;
35
    }
36
37 1
    public static function styled($style, $text) {
38 1
        return self::get()->styled($style, $text);
39
    }
40
41 2
    public static function open($style)
42
    {
43 2
        return self::get()->open($style);
44
    }
45
46 2
    public static function close()
47
    {
48 2
        return self::get()->close();
49
    }
50
51 2
    public static function reset() {
52 2
        return self::get()->reset();
53
    }
54
}