| Conditions | 3 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | 15 | public function slumber(Slumberer $slumberer, $value) |
|
| 46 | { |
||
| 47 | /** |
||
| 48 | * unwrap any wrappers like LazyDbReference |
||
| 49 | * @see LazyDbReference |
||
| 50 | */ |
||
| 51 | 15 | if ($value instanceof ValueHolder) { |
|
| 52 | |||
| 53 | // TODO: Rethink this! Is this really a good idea or should it only happen in the Mongo ObjectMapper and only for LazyDbReference ? |
||
| 54 | // This might trigger in cases where it is not really wanted. |
||
| 55 | |||
| 56 | 1 | $value = $value->getValue(); |
|
| 57 | } |
||
| 58 | |||
| 59 | 15 | if ($value instanceof $this->options->value) { |
|
| 60 | 3 | return $slumberer->slumber($value); |
|
| 61 | } |
||
| 62 | |||
| 63 | 12 | return null; |
|
| 64 | } |
||
| 83 |