BasicTerminalObject   A
last analyzed

Coupling/Cohesion

Components 1
Dependencies 3

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 37
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 6 2
A getParser() 0 4 1
A sameLine() 0 4 1
1
<?php
2
3
namespace League\CLImate\TerminalObject\Basic;
4
5
use League\CLImate\Decorator\Parser\ParserImporter;
6
use League\CLImate\Settings\SettingsImporter;
7
use League\CLImate\Util\UtilImporter;
8
9
abstract class BasicTerminalObject implements BasicTerminalObjectInterface
10
{
11
    use SettingsImporter, ParserImporter, UtilImporter;
12
13
    /**
14
     * Set the property if there is a valid value
15
     *
16
     * @param string $key
17
     * @param string $value
18
     */
19 96
    protected function set($key, $value)
20
    {
21 96
        if (strlen($value)) {
22 52
            $this->$key = $value;
23 52
        }
24 96
    }
25
26
    /**
27
     * Get the parser for the current object
28
     *
29
     * @return \League\CLImate\Decorator\Parser\Parser
30
     */
31 356
    public function getParser()
32
    {
33 356
        return $this->parser;
34
    }
35
36
    /**
37
     * Check if this object requires a new line to be added after the output
38
     *
39
     * @return boolean
40
     */
41 336
    public function sameLine()
42
    {
43 336
        return false;
44
    }
45
}
46