BasicTerminalObject::getParser()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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