original_string: public function addRenderer($name, $renderer, $overwrite = false)
      {
          if (isset($this->renderers[$name]) && !$overwrite) {
              throw new InvalidArgumentException("Renderer with name '$name' is already registered.");
          }
          unset($this->renderers[$name]);
          // Is class? Exists?
          if (is_string($renderer) && !class_exists($renderer)) {
              throw new InvalidArgumentException("Renderer class '$renderer' doesn't exist.");
          }
          $this->renderers[$name] = $renderer;
          return $this;
      }
code: public function addRenderer($name, $renderer, $overwrite = false)
      {
          if (isset($this->renderers[$name]) && !$overwrite) {
              throw new InvalidArgumentException("Renderer with name '$name' is already registered.");
          }
          unset($this->renderers[$name]);
          // Is class? Exists?
          if (is_string($renderer) && !class_exists($renderer)) {
              throw new InvalidArgumentException("Renderer class '$renderer' doesn't exist.");
          }
          $this->renderers[$name] = $renderer;
          return $this;
      }
code_tokens: public function addRenderer ( $ name , $ renderer , $ overwrite = false ) { if ( isset ( $ this -> renderers [ $ name ] ) && ! $ overwrite ) { throw new InvalidArgumentException ( "Renderer with name '$name' is already registered." ) ; } unset ( $ this -> renderers [ $ name ] ) ; // Is class? Exists? if ( is_string ( $ renderer ) && ! class_exists ( $ renderer ) ) { throw new InvalidArgumentException ( "Renderer class '$renderer' doesn't exist." ) ; } $ this -> renderers [ $ name ] = $ renderer ; return $ this ; }
docstring: Ads renderer with given name
  @param string $name Name of the renderer
  @param string|IRenderer $renderer Renderer class name or instance
  @param bool $overwrite Should be overwritten renderer with this name if exists?
  @return IManager Fluent interface
  @throws InvalidArgumentException If the renderer with given name already exists and $overwrite is false
docstring_tokens: Ads renderer with given name