StringOutput::clear()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: sheldon
5
 * Date: 18-4-19
6
 * Time: 下午2:23.
7
 */
8
9
namespace Yeelight\Models\Tools\Terminal;
10
11
use Symfony\Component\Console\Output\Output;
12
13
/**
14
 * Class StringOutput
15
 *
16
 * @category Yeelight
17
 *
18
 * @package Yeelight\Models\Tools\Terminal
19
 *
20
 * @author Sheldon Lee <[email protected]>
21
 *
22
 * @license https://opensource.org/licenses/MIT MIT
23
 *
24
 * @link https://www.yeelight.com
25
 */
26
class StringOutput extends Output
27
{
28
    public $output = '';
29
30
    public function clear()
31
    {
32
        $this->output = '';
33
    }
34
35
    protected function doWrite($message, $newline)
36
    {
37
        $this->output .= $message.($newline ? "\n" : '');
38
    }
39
40
    public function getContent()
41
    {
42
        return trim($this->output);
43
    }
44
}
45