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