Completed
Push — master ( 668b32...3793ef )
by WEBEWEB
01:37
created

CommandHelper::getCheckbox()   A

Complexity

Conditions 4
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 4
nc 2
nop 1
1
<?php
2
3
/**
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Helper;
13
14
/**
15
 * Command helper.
16
 *
17
 * @author webeweb <https://github.com/webeweb/>
18
 * @package WBW\Bundle\CoreBundle\Helper
19
 */
20
class CommandHelper {
21
22
    /**
23
     * Get a checkbox.
24
     *
25
     * @param bool $checked Checked ?
26
     * @return string Returns the checkbox.
27
     */
28
    public static function getCheckbox($checked) {
29
        if (true === $checked) {
30
            return sprintf("<fg=green;options=bold>%s</>", "\\" === DIRECTORY_SEPARATOR ? "OK" : "\xE2\x9C\x94");
31
        }
32
        return sprintf("<fg=yellow;options=bold>%s</>", "\\" === DIRECTORY_SEPARATOR ? "KO" : "!");
33
    }
34
35
}
36