Predis\Connection\StreamConnection::__destruct PHP Method

__destruct() public method

Disconnects from the server and destroys the underlying resource when the garbage collector kicks in only if the connection has not been marked as persistent.
public __destruct ( )
    public function __destruct()
    {
        if (isset($this->parameters->persistent) && $this->parameters->persistent) {
            return;
        }
        $this->disconnect();
    }

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function __destruct()
 {
     phpiredis_reader_destroy($this->reader);
     parent::__destruct();
 }