FormatterAwareTrait::setFormatter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
namespace Consolidation\OutputFormatters\Formatters;
3
4
trait FormatterAwareTrait
5
{
6
    protected $formatter;
7
8
    public function setFormatter(FormatterInterface $formatter)
9
    {
10
        $this->formatter = $formatter;
11
    }
12
13
    public function getFormatter()
14
    {
15
        return $this->formatter;
16
    }
17
18
    public function isHumanReadable()
19
    {
20
        return $this->formatter && $this->formatter instanceof \Consolidation\OutputFormatters\Formatters\HumanReadableFormat;
21
    }
22
}
23