Stack::getStack()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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