| Total Complexity | 4 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | final class DefaultReaderContext extends DefaultContext implements ReaderContext |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * True if we're reading into an existing object |
||
| 23 | * |
||
| 24 | * @var bool |
||
| 25 | */ |
||
| 26 | private $usesExistingObject = false; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * The initial json_decode'd payload |
||
| 30 | * |
||
| 31 | * @var mixed |
||
| 32 | */ |
||
| 33 | 5 | private $payload; |
|
| 34 | |||
| 35 | 5 | /** |
|
| 36 | * If we're reading into an existing object |
||
| 37 | * |
||
| 38 | * @return bool |
||
| 39 | */ |
||
| 40 | public function usesExistingObject(): bool |
||
| 41 | { |
||
| 42 | return $this->usesExistingObject; |
||
| 43 | } |
||
| 44 | 4 | ||
| 45 | /** |
||
| 46 | 4 | * When deserializing into an existing object |
|
| 47 | * |
||
| 48 | 4 | * @param bool $usesExistingObject |
|
| 49 | * @return ReaderContext |
||
| 50 | */ |
||
| 51 | public function setUsesExistingObject(bool $usesExistingObject): ReaderContext |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return mixed |
||
| 60 | */ |
||
| 61 | public function getPayload() |
||
| 62 | { |
||
| 63 | return $this->payload; |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @param mixed $payload |
||
| 68 | * @return DefaultReaderContext |
||
| 69 | */ |
||
| 70 | public function setPayload($payload): DefaultReaderContext |
||
| 75 | } |
||
| 76 | } |
||
| 77 |