original_string: public function register_dependency(setting_dependency $dependency) {
          if ($this->is_circular_reference($dependency->get_dependent_setting())) {
              $a = new stdclass();
              $a->alreadydependent = $this->name;
              $a->main = $dependency->get_dependent_setting()->get_name();
              throw new base_setting_exception('setting_circular_reference', $a);
          }
          $this->dependencies[$dependency->get_dependent_setting()->get_name()] = $dependency;
          $dependency->get_dependent_setting()->register_dependent_dependency($dependency);
      }
code: public function register_dependency(setting_dependency $dependency) {
          if ($this->is_circular_reference($dependency->get_dependent_setting())) {
              $a = new stdclass();
              $a->alreadydependent = $this->name;
              $a->main = $dependency->get_dependent_setting()->get_name();
              throw new base_setting_exception('setting_circular_reference', $a);
          }
          $this->dependencies[$dependency->get_dependent_setting()->get_name()] = $dependency;
          $dependency->get_dependent_setting()->register_dependent_dependency($dependency);
      }
code_tokens: public function register_dependency ( setting_dependency $ dependency ) { if ( $ this -> is_circular_reference ( $ dependency -> get_dependent_setting ( ) ) ) { $ a = new stdclass ( ) ; $ a -> alreadydependent = $ this -> name ; $ a -> main = $ dependency -> get_dependent_setting ( ) -> get_name ( ) ; throw new base_setting_exception ( 'setting_circular_reference' , $ a ) ; } $ this -> dependencies [ $ dependency -> get_dependent_setting ( ) -> get_name ( ) ] = $ dependency ; $ dependency -> get_dependent_setting ( ) -> register_dependent_dependency ( $ dependency ) ; }
docstring: Adds a dependency where another setting depends on this setting.
  @param setting_dependency $dependency
docstring_tokens: Adds a dependency where another setting depends on this setting .