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

SharedHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 1
A getRecords() 0 4 1
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
}