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

DumpLoggerTrait::dump()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 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