| Total Complexity | 5 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class OldInput { |
||
| 12 | /** |
||
| 13 | * Flash service. |
||
| 14 | * |
||
| 15 | * @var Flash |
||
| 16 | */ |
||
| 17 | protected $flash = null; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Key to store the flashed data with. |
||
| 21 | * |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | protected $flash_key = ''; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Constructor. |
||
| 28 | * |
||
| 29 | * @codeCoverageIgnore |
||
| 30 | * @param Flash $flash |
||
| 31 | * @param string $flash_key |
||
| 32 | */ |
||
| 33 | public function __construct( Flash $flash, $flash_key = '__wpemergeOldInput' ) { |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Get whether the old input service is enabled. |
||
| 40 | * |
||
| 41 | * @return boolean |
||
| 42 | */ |
||
| 43 | 1 | public function enabled() { |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Get request value for key from the previous request. |
||
| 49 | * |
||
| 50 | * @param string $key |
||
| 51 | * @param mixed $default |
||
| 52 | * @return mixed |
||
| 53 | */ |
||
| 54 | 1 | public function get( $key, $default = null ) { |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Set input for the next request. |
||
| 60 | * |
||
| 61 | * @param array $input |
||
| 62 | */ |
||
| 63 | 1 | public function set( $input ) { |
|
| 64 | 1 | $this->flash->add( $this->flash_key, $input ); |
|
| 65 | 1 | } |
|
| 66 | |||
| 67 | /** |
||
| 68 | * Clear input for the next request. |
||
| 69 | * |
||
| 70 | * @return void |
||
| 71 | */ |
||
| 72 | 1 | public function clear() { |
|
| 74 | 1 | } |
|
| 75 | } |
||
| 76 |