Completed
Push — master ( 039dcf...417ea8 )
by Maik
03:08
created

DumpLoggerTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

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 1
    public function dump($o)
26
    {
27 1
        $out = var_export($o, true);
28 1
        $this->debug("Contents of {object}\n{dump}", array(
29 1
            'object' => gettype($o),
30 1
            'dump' => $out
31
        ));
32 1
    }
33
}
34