original_string: public function addSetting(Setting $setting)
      {
          $name = $setting->getName();
  
          if (isset($this->settings[$name])) {
              throw new \Exception(sprintf('A setting with name "%s" does already exist for plugin "%s"', $name, $this->pluginName));
          }
  
          $this->settings[$name] = $setting;
      }
code: public function addSetting(Setting $setting)
      {
          $name = $setting->getName();
  
          if (isset($this->settings[$name])) {
              throw new \Exception(sprintf('A setting with name "%s" does already exist for plugin "%s"', $name, $this->pluginName));
          }
  
          $this->settings[$name] = $setting;
      }
code_tokens: public function addSetting ( Setting $ setting ) { $ name = $ setting -> getName ( ) ; if ( isset ( $ this -> settings [ $ name ] ) ) { throw new \ Exception ( sprintf ( 'A setting with name "%s" does already exist for plugin "%s"' , $ name , $ this -> pluginName ) ) ; } $ this -> settings [ $ name ] = $ setting ; }
docstring: Adds a new setting to the settings container.
  
  @param Setting $setting
  @throws \Exception       If there is a setting with the same name that already exists.
  If the name contains non-alphanumeric characters.
docstring_tokens: Adds a new setting to the settings container .