protected function parseData(string $key) : array
    {
        if (file_exists($this->getPath($key))) {
            $rawData = json_decode(file_get_contents($this->getPath($key)), true);
            $parsedData = ['d' => unserialize($rawData['d']), 't' => $rawData['t']];
        } else {
            $parsedData = ['d' => null, 't' => 0];
        }

        if (time() > $parsedData['t']) {
            $this->delete($key);

            return ['d' => null, 't' => 0];
        }

        return $parsedData;
    }
protected function parseData(string $key) : array
    {
        if (file_exists($this->getPath($key))) {
            $rawData = json_decode(file_get_contents($this->getPath($key)), true);
            $parsedData = ['d' => unserialize($rawData['d']), 't' => $rawData['t']];
        } else {
            $parsedData = ['d' => null, 't' => 0];
        }

        if (time() > $parsedData['t']) {
            $this->delete($key);

            return ['d' => null, 't' => 0];
        }

        return $parsedData;
    }
protected function parseData ( string $ key ) : array { if ( file_exists ( $ this -> getPath ( $ key ) ) ) { $ rawData = json_decode ( file_get_contents ( $ this -> getPath ( $ key ) ) , true ) ; $ parsedData = [ 'd' => unserialize ( $ rawData [ 'd' ] ) , 't' => $ rawData [ 't' ] ] ; } else { $ parsedData = [ 'd' => null , 't' => 0 ] ; } if ( time ( ) > $ parsedData [ 't' ] ) { $ this -> delete ( $ key ) ; return [ 'd' => null , 't' => 0 ] ; } return $ parsedData ; }
Runs garbage collection on a key, if necessary

@param string $key The key to run garbage collection on
@return array The array of data after running any garbage collection
Runs garbage collection on a key if necessary