Conditions | 3 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
44 | 31 | public function mergeContext(array $context, bool $override = true): TextInterface |
|
45 | { |
||
46 | 31 | if (empty($context)) { |
|
47 | throw new InvalidArgumentException('Context trying to be merged is empty'); |
||
48 | } |
||
49 | 3 | ||
50 | return self::create( |
||
51 | 3 | $this->getContent(), |
|
52 | 1 | $override ? array_merge($this->getContext(), $context) : array_merge($context, $this->getContext()) |
|
53 | ); |
||
56 |