public function clear($key = null)
    {
        if (isset($key)) {
            if (isset($this->data[$key])) {
                unset($this->data[$key]);
            }
        } else {
            $this->data = [];
        }
    }
public function clear($key = null)
    {
        if (isset($key)) {
            if (isset($this->data[$key])) {
                unset($this->data[$key]);
            }
        } else {
            $this->data = [];
        }
    }
public function clear ( $ key = null ) { if ( isset ( $ key ) ) { if ( isset ( $ this -> data [ $ key ] ) ) { unset ( $ this -> data [ $ key ] ) ; } } else { $ this -> data = [ ] ; } }
Clear a key within the cache data, or call without an argument to clear all the cached data.

@param string $key The key of the cached data

@return void
Clear a key within the cache data or call without an argument to clear all the cached data .