1: <?php
2:
3: namespace PHPixie\Debug\Logger;
4:
5: class Item
6: {
7: protected $dumper;
8: protected $traceElement;
9: protected $value;
10:
11: protected $shortDumpByDefault;
12:
13: public function __construct($dumper, $traceElement, $value, $shortDumpByDefault = false)
14: {
15: $this->dumper = $dumper;
16: $this->traceElement = $traceElement;
17: $this->value = $value;
18: $this->shortDumpByDefault = $shortDumpByDefault;
19: }
20:
21: public function traceElement()
22: {
23: return $this->traceElement;
24: }
25:
26: public function value()
27: {
28: return $this->value;
29: }
30:
31: public function valueDump($short = null)
32: {
33: if($short === null) {
34: $short = $this->shortDumpByDefault;
35: }
36:
37: return $this->dumper->dump($this->value, $short);
38: }
39:
40: public function asString($withTraceArguments = true, $shortValueDump = null)
41: {
42: $string = $this->traceElement->asString($withTraceArguments, false);
43: $string.= "\n".$this->valueDump($shortValueDump);
44: return $string;
45: }
46:
47: public function __toString()
48: {
49: return $this->asString();
50: }
51: }