| Total Complexity | 5 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class Payload |
||
| 6 | { |
||
| 7 | protected $context = []; |
||
| 8 | |||
| 9 | public function add($key, $value) |
||
| 10 | { |
||
| 11 | $this->context[$key] = $value; |
||
| 12 | |||
| 13 | return $this; |
||
| 14 | } |
||
| 15 | |||
| 16 | public function get($key, $default = null) |
||
| 17 | { |
||
| 18 | if ($this->doesNotExist($key)) { |
||
| 19 | return $default; |
||
| 20 | } |
||
| 21 | |||
| 22 | return $this->context[$key] ?? $default; |
||
| 23 | } |
||
| 24 | |||
| 25 | public function exists($key) |
||
| 28 | } |
||
| 29 | |||
| 30 | public function doesNotExist($key) |
||
| 33 | } |
||
| 34 | } |
||
| 35 |