Completed
Branch dbal-improvement (e43d29)
by Anton
06:02
created

SharedHandler::getRecords()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Spiral Framework.
4
 *
5
 * @license   MIT
6
 * @author    Anton Titov (Wolfy-J)
7
 */
8
namespace Spiral\Debug\Logger;
9
10
use Monolog\Handler\AbstractHandler;
11
12
/**
13
 * Stores log messages in memory.
14
 */
15
class SharedHandler extends AbstractHandler
16
{
17
    /**
18
     * @var array
19
     */
20
    protected $records = [];
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function handle(array $record)
26
    {
27
        $this->records[] = $record;
28
29
        //Passing
30
        return false;
31
    }
32
33
    /**
34
     * All collected records.
35
     *
36
     * @return array
37
     */
38
    public function getRecords()
39
    {
40
        return $this->records;
41
    }
42
}