for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WPEmerge\Input;
use Flash;
use WPEmerge\Support\Arr;
/**
* Provide a way to get values from the previous request
*/
class OldInput {
* Key to store the flashed data with
*
* @var string
const FLASH_KEY = '__wpEmergeOldInput';
* Get all previously flashed request data
* @return array
public function all() {
return Flash::peek( static::FLASH_KEY );
}
* Get any previously flashed request data value
* @see Arr::get()
public function get() {
$arguments = array_merge( [
static::all(),
], func_get_args() );
return call_user_func_array( [Arr::class, 'get'], $arguments );
* Clear previously stored input
public function clear() {
// @codeCoverageIgnoreStart
if ( ! Flash::enabled() ) {
return;
// @codeCoverageIgnoreEnd
Flash::clear( static::FLASH_KEY );
* Store the current input
* @param array $input
public function store( $input ) {
Flash::add( static::FLASH_KEY, $input );