| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 52 | 3 | public function concat(StreamInterface $stream, bool $preserveKeys = true): StreamInterface |
|
| 53 | { |
||
| 54 | // Do not preserve key for previous streams, but keep for new stream |
||
| 55 | // => Create a new ContactStream for keeping new stream keys |
||
| 56 | 3 | if (!$this->preserveKeys && $preserveKeys) { |
|
| 57 | 1 | return new ConcatStream([$this, $stream], true); |
|
| 58 | } |
||
| 59 | |||
| 60 | // If keys are not preserved for the last stream |
||
| 61 | // All the previous streams wil also loose their keys |
||
| 62 | 2 | if (!$preserveKeys) { |
|
| 63 | 1 | $this->preserveKeys = false; |
|
| 64 | } |
||
| 65 | |||
| 66 | 2 | $this->append($stream); |
|
| 67 | |||
| 68 | 2 | return $this; |
|
| 69 | } |
||
| 104 |