| Total Complexity | 3 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 5 | trait FormStatus |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Add success status to the view model. |
||
| 9 | * |
||
| 10 | * @return $this |
||
| 11 | */ |
||
| 12 | public function withSuccess(): self |
||
| 13 | { |
||
| 14 | $this->withStatus('success'); |
||
| 15 | |||
| 16 | return $this; |
||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Add success status to the view model. |
||
| 21 | * |
||
| 22 | * @return $this |
||
| 23 | */ |
||
| 24 | public function withFailure(): self |
||
| 25 | { |
||
| 26 | $this->withStatus('failure'); |
||
| 27 | |||
| 28 | return $this; |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Set a Client Inquiry success/failure status to be displayed in the view model. |
||
| 33 | * |
||
| 34 | * @param string $status |
||
| 35 | * @return $this |
||
| 36 | */ |
||
| 37 | private function withStatus(string $status): self |
||
| 42 | } |
||
| 43 | } |
||
| 44 |