| @@ 16-26 (lines=11) @@ | ||
| 13 | { |
|
| 14 | } |
|
| 15 | ||
| 16 | public function withRoot($root) |
|
| 17 | { |
|
| 18 | $context = new self(); |
|
| 19 | ||
| 20 | $context->root = $root; |
|
| 21 | $context->format = $this->format; |
|
| 22 | $context->parent = $this->parent; |
|
| 23 | $context->level = $this->level; |
|
| 24 | ||
| 25 | return $context; |
|
| 26 | } |
|
| 27 | ||
| 28 | public function getRoot() |
|
| 29 | { |
|
| @@ 33-43 (lines=11) @@ | ||
| 30 | return $this->root; |
|
| 31 | } |
|
| 32 | ||
| 33 | public function withFormat($format) |
|
| 34 | { |
|
| 35 | $context = new self(); |
|
| 36 | ||
| 37 | $context->root = $this->root; |
|
| 38 | $context->format = $format; |
|
| 39 | $context->parent = $this->parent; |
|
| 40 | $context->level = $this->level; |
|
| 41 | ||
| 42 | return $context; |
|
| 43 | } |
|
| 44 | ||
| 45 | public function getFormat() |
|
| 46 | { |
|
| @@ 50-60 (lines=11) @@ | ||
| 47 | return $this->format; |
|
| 48 | } |
|
| 49 | ||
| 50 | public function withParent($parent) |
|
| 51 | { |
|
| 52 | $context = new self(); |
|
| 53 | ||
| 54 | $context->root = $this->root; |
|
| 55 | $context->format = $this->format; |
|
| 56 | $context->parent = $parent; |
|
| 57 | $context->level = $this->level + 1; |
|
| 58 | ||
| 59 | return $context; |
|
| 60 | } |
|
| 61 | ||
| 62 | public function getParent() |
|
| 63 | { |
|