original_string: public function removeEventListener(string $name, callable $listener): self
      {
          if (isset($this->internalEventListenersData[$name])) {
              foreach ($this->internalEventListenersData[$name] as $i => $value) {
                  if ($value === $listener) {
                      unset($this->internalEventListenersData[$name][$i]);
                      if (empty($this->internalEventListenersData[$name])) {
                          unset($this->internalEventListenersData[$name]);
                      }
                      break;
                  }
              }
          }
          return $this;
      }
code: public function removeEventListener(string $name, callable $listener): self
      {
          if (isset($this->internalEventListenersData[$name])) {
              foreach ($this->internalEventListenersData[$name] as $i => $value) {
                  if ($value === $listener) {
                      unset($this->internalEventListenersData[$name][$i]);
                      if (empty($this->internalEventListenersData[$name])) {
                          unset($this->internalEventListenersData[$name]);
                      }
                      break;
                  }
              }
          }
          return $this;
      }
code_tokens: public function removeEventListener ( string $ name , callable $ listener ) : self { if ( isset ( $ this -> internalEventListenersData [ $ name ] ) ) { foreach ( $ this -> internalEventListenersData [ $ name ] as $ i => $ value ) { if ( $ value === $ listener ) { unset ( $ this -> internalEventListenersData [ $ name ] [ $ i ] ) ; if ( empty ( $ this -> internalEventListenersData [ $ name ] ) ) { unset ( $ this -> internalEventListenersData [ $ name ] ) ; } break ; } } } return $ this ; }
docstring: Removes a registered event listener.
  
  @param string $name The name of the event.
  @param callable $listener A listener callback.
  @return self Returns a reference to itself.
docstring_tokens: Removes a registered event listener .