Completed
Push — master ( 9d0a53...ecd7bc )
by Maik
01:48
created

DumpLoggerTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 19
ccs 0
cts 8
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
debug() 0 1 ?
A dump() 0 8 1
1
<?php
2
3
/**
4
 * This file is part of the PHP Generics package.
5
 *
6
 * @package Generics
7
 */
8
namespace Generics\Logger;
9
10
/**
11
 * Implementation for logging dumps of objects
12
 *
13
 * @author Maik Greubel <[email protected]>
14
 */
15
trait DumpLoggerTrait
16
{
17
18
    abstract public function debug($message, array $context = array());
19
20
    /**
21
     *
22
     * {@inheritdoc}
23
     * @see \Generics\Logger\DumpLogger::dump()
24
     */
25
    public function dump($o)
26
    {
27
        $out = var_export($o, true);
28
        $this->debug("Contents of {object}\n{dump}", array(
29
            'object' => gettype($o),
30
            'dump' => $out
31
        ));
32
    }
33
}
34