type; } /** * {@inheritdoc} */ public function getStatus() : int { return $this->status; } /** * Get database name. * * @return string * * @since 1.0.0 */ public function getCache() : string { return (string) ($this->dbdata['db'] ?? ''); } /** * Get database host. * * @return string * * @since 1.0.0 */ public function getHost() : string { return $this->dbdata['host'] ?? ''; } /** * Get database port. * * @return int * * @since 1.0.0 */ public function getPort() : int { return (int) $this->dbdata['port'] ?? 0; } /** * Get table prefix. * * @return string * * @since 1.0.0 */ public function getPrefix() : string { return $this->prefix; } /** * Object destructor. * * Sets the database connection to null * * @since 1.0.0 */ public function __destruct() { $this->close(); } /** * {@inheritdoc} */ public function close() : void { $this->con = null; $this->status = CacheStatus::CLOSED; } /** * Parse values for cache storage * * @param mixed $value Value to parse * * @return mixed * * @since 1.0.0 */ protected function parseValue($value) { if (\is_array($value)) { return \json_encode($value); } return $value; } }