NullFormatter::format()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
3
/*
4
 * This file is part of the webmozart/console 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 Webmozart\Console\Formatter;
13
14
use Webmozart\Console\Api\Formatter\Formatter;
15
use Webmozart\Console\Api\Formatter\Style;
16
17
/**
18
 * A formatter that returns all text unchanged.
19
 *
20
 * @since  1.0
21
 *
22
 * @author Bernhard Schussek <[email protected]>
23
 */
24
class NullFormatter implements Formatter
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29 19
    public function format($string, Style $style = null)
30
    {
31 19
        return $string;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function removeFormat($string)
38
    {
39
        return $string;
40
    }
41
}
42