Completed
Pull Request — master (#27)
by Hari
09:21
created

PuliTableStyle   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 3
dl 0
loc 26
ccs 0
cts 11
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A borderless() 0 13 2
1
<?php
2
3
/*
4
 * This file is part of the puli/cli package.
5
 *
6
 * (c) Bernhard Schussek <[email protected]>
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 Puli\Cli\Style;
13
14
use Webmozart\Console\Api\Formatter\Style;
15
use Webmozart\Console\UI\Style\BorderStyle;
16
use Webmozart\Console\UI\Style\TableStyle;
17
18
/**
19
 * Contains the default table styles of Puli.
20
 *
21
 * @since  1.0
22
 *
23
 * @author Bernhard Schussek <[email protected]>
24
 */
25
class PuliTableStyle extends TableStyle
26
{
27
    /**
28
     * @var TableStyle
29
     */
30
    private static $borderless;
31
32
    /**
33
     * A borderless style.
34
     *
35
     * @return TableStyle The style.
36
     */
37
    public static function borderless()
38
    {
39
        if (!self::$borderless) {
40
            $borderStyle = BorderStyle::none();
41
            $borderStyle->setLineVCChar('  ');
42
43
            self::$borderless = new static();
44
            self::$borderless->setBorderStyle($borderStyle);
45
            self::$borderless->setHeaderCellStyle(Style::noTag()->bold());
46
        }
47
48
        return clone self::$borderless;
49
    }
50
}
51