| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.1406 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 1 | public function add(PredictionContext $ctx) : PredictionContext |
|
| 30 | { |
||
| 31 | 1 | if ($ctx === PredictionContext::empty()) { |
|
|
|
|||
| 32 | return $ctx; |
||
| 33 | } |
||
| 34 | |||
| 35 | 1 | $existing = $this->cache->get($ctx); |
|
| 36 | |||
| 37 | 1 | if ($existing !== null) { |
|
| 38 | return $existing; |
||
| 39 | } |
||
| 40 | |||
| 41 | 1 | $this->cache->put($ctx, $ctx); |
|
| 42 | |||
| 43 | 1 | return $ctx; |
|
| 44 | } |
||
| 56 |