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

DumpLoggerTrait::debug()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
nc 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