original_string: private function handleClose()
      {
          foreach ($this->timer as $timer) {
              $this->loop->cancelTimer($timer);
          }
  
          $connection = $this->connection;
  
          $this->isConnecting = false;
          $this->isDisconnecting = false;
          $this->isConnected = false;
          $this->connection = null;
          $this->stream = null;
  
          if ($connection !== null) {
              $this->emit('close', [$connection, $this]);
          }
      }
code: private function handleClose()
      {
          foreach ($this->timer as $timer) {
              $this->loop->cancelTimer($timer);
          }
  
          $connection = $this->connection;
  
          $this->isConnecting = false;
          $this->isDisconnecting = false;
          $this->isConnected = false;
          $this->connection = null;
          $this->stream = null;
  
          if ($connection !== null) {
              $this->emit('close', [$connection, $this]);
          }
      }
code_tokens: private function handleClose ( ) { foreach ( $ this -> timer as $ timer ) { $ this -> loop -> cancelTimer ( $ timer ) ; } $ connection = $ this -> connection ; $ this -> isConnecting = false ; $ this -> isDisconnecting = false ; $ this -> isConnected = false ; $ this -> connection = null ; $ this -> stream = null ; if ( $ connection !== null ) { $ this -> emit ( 'close' , [ $ connection , $ this ] ) ; } }
docstring: Handles closing of the stream.
docstring_tokens: Handles closing of the stream .