original_string: public function clean($params = [])
      {
          if ( ! empty($this->config['primary_config_file']))
          {
              $default_settings = Arr::dot(Config::get($this->config['primary_config_file']));
              $saved_settings   = Arr::dot($this->getAll($cache = false));
  
              if (array_key_exists('flush', $params) && $params['flush'] == true)
              {
                  $this->flush();
  
                  $saved_settings = [];
              }
              else
              {
                  foreach ($saved_settings as $key => $value)
                  {
                      if ( ! array_key_exists($key, $default_settings))
                      {
                          if ( ! key_represents_an_array($key, $default_settings))
                          {
                              $this->forget($key);
                          }
                      }
                  }
              }
  
  
              // update with new settings
              foreach ($default_settings as $key => $value)
              {
                  if ( ! preg_key_exists($key, $saved_settings))
                  {
                      // check if key does not represents an array and exists in saved settings
                      if ( ! key_represents_an_array($key, $saved_settings))
                      {
                          $this->set($key, $value);
                      }
                  }
              }
          }
      }
code: public function clean($params = [])
      {
          if ( ! empty($this->config['primary_config_file']))
          {
              $default_settings = Arr::dot(Config::get($this->config['primary_config_file']));
              $saved_settings   = Arr::dot($this->getAll($cache = false));
  
              if (array_key_exists('flush', $params) && $params['flush'] == true)
              {
                  $this->flush();
  
                  $saved_settings = [];
              }
              else
              {
                  foreach ($saved_settings as $key => $value)
                  {
                      if ( ! array_key_exists($key, $default_settings))
                      {
                          if ( ! key_represents_an_array($key, $default_settings))
                          {
                              $this->forget($key);
                          }
                      }
                  }
              }
  
  
              // update with new settings
              foreach ($default_settings as $key => $value)
              {
                  if ( ! preg_key_exists($key, $saved_settings))
                  {
                      // check if key does not represents an array and exists in saved settings
                      if ( ! key_represents_an_array($key, $saved_settings))
                      {
                          $this->set($key, $value);
                      }
                  }
              }
          }
      }
code_tokens: public function clean ( $ params = [ ] ) { if ( ! empty ( $ this -> config [ 'primary_config_file' ] ) ) { $ default_settings = Arr :: dot ( Config :: get ( $ this -> config [ 'primary_config_file' ] ) ) ; $ saved_settings = Arr :: dot ( $ this -> getAll ( $ cache = false ) ) ; if ( array_key_exists ( 'flush' , $ params ) && $ params [ 'flush' ] == true ) { $ this -> flush ( ) ; $ saved_settings = [ ] ; } else { foreach ( $ saved_settings as $ key => $ value ) { if ( ! array_key_exists ( $ key , $ default_settings ) ) { if ( ! key_represents_an_array ( $ key , $ default_settings ) ) { $ this -> forget ( $ key ) ; } } } } // update with new settings foreach ( $ default_settings as $ key => $ value ) { if ( ! preg_key_exists ( $ key , $ saved_settings ) ) { // check if key does not represents an array and exists in saved settings if ( ! key_represents_an_array ( $ key , $ saved_settings ) ) { $ this -> set ( $ key , $ value ) ; } } } } }
docstring: Cleans settings that are no longer used in primary config file
  
  @param $params
docstring_tokens: Cleans settings that are no longer used in primary config file