Stack::write()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 1
cts 1
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Simplario\Checker\Output;
4
5
/**
6
 * Class Stack
7
 *
8
 * @package Simplario\Checker\Output
9
 */
10
class Stack extends AbstractOutput
11 2
{
12
    /**
13 2
     * @var array
14 2
     */
15 2
    protected $stack = [];
16
17
    /**
18 2
     * @param string $msg
19
     * @param string $type
20
     *
21 2
     * @return $this
22
     */
23 2
    public function write($msg = '', $type = self::TYPE_DEFAULT)
24
    {
25
        $this->stack[] = [
26
            'message' => $msg,
27
            'type'    => $type,
28
        ];
29
30
        return $this;
31
    }
32
33
    /**
34
     * @return array
35
     */
36
    public function getStack()
37
    {
38
        return $this->stack;
39
    }
40
}
41