Runtime::write()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
/**
4
 * This file is part of the Apix Project.
5
 *
6
 * (c) Franck Cassedanne <franck at ouarz.net>
7
 *
8
 * @license http://opensource.org/licenses/BSD-3-Clause  New BSD License
9
 */
10
11
namespace Apix\Log\Logger;
12
13
use Apix\Log\LogEntry;
14
15
/**
16
 * Runtime (Array/ArrayObject) log wrapper.
17
 *
18
 * @author Franck Cassedanne <franck at ouarz.net>
19
 */
20
class Runtime extends AbstractLogger implements LoggerInterface
21
{
22
    /**
23
     * Holds the logged items.
24
     * @var array
25
     */
26
    protected $items = array();
27
28
    /**
29
     * {@inheritDoc}
30
     */
31 196
    public function write(LogEntry $log)
32
    {
33 196
        $this->items[] = (string) $log;
34 49
    }
35
36
    /**
37
     * Returns the logged items.
38
     *
39
     * @return array
40
     */
41 188
    public function getItems()
42
    {
43 188
        return $this->items;
44
    }
45
46
}
47