| Total Complexity | 2 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | trait OldValueSupportTrait |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Whether to enable the retrievement of the submitted value in case of |
||
| 9 | * validation errors. If enabled, the submitted value will be automatically |
||
| 10 | * shown when there is a validation error. |
||
| 11 | * |
||
| 12 | * @var bool |
||
| 13 | */ |
||
| 14 | public $enableOldSupport; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Gets the previous submitted value for an input item. When the old value |
||
| 18 | * support is disabled or the old value can't be found, the specified |
||
| 19 | * default value is returned. |
||
| 20 | * |
||
| 21 | * @param string $errorKey The key to use for look up the old value |
||
| 22 | * @param mixed $default Default value to use when there isn't old value |
||
| 23 | * @return mixed |
||
| 24 | */ |
||
| 25 | 9 | public function getOldValue($errorKey, $default = null) |
|
| 30 |