1: <?php
2:
3: namespace PHPixie\Debug\Tracer;
4:
5: class Trace
6: {
7: protected $elements;
8:
9: public function __construct($elements = array())
10: {
11: $this->elements = $elements;
12: }
13:
14: public function elements()
15: {
16: return $this->elements;
17: }
18:
19: public function asString($withArguments = true)
20: {
21: $string = '';
22: foreach($this->elements as $key => $element) {
23: if($key > 0) {
24: $string.="\n";
25: }
26:
27: $string.= '#'.$key.' '.$element->asString($withArguments);
28: }
29:
30: return $string;
31: }
32:
33: public function __toString()
34: {
35: return $this->asString();
36: }
37: }