original_string: public static function getConfig(Loops $loops = NULL, ArrayObject $config = NULL) {
          if(!$loops) {
              $loops = Loops::getCurrentLoops();
          }
  
          if(!$config) {
              $parts = explode("\\", get_called_class());
              if(count($parts) > 2 && array_slice($parts, 0, 2) == [ "Loops", "Service" ]) {
                  $parts = array_slice($parts, 2);
              }
  
              $sectionname = Misc::underscore(implode("\\", $parts));
  
              $config = $loops->getService('config');
              $config = $config->offsetExists($sectionname) ? $config->offsetGet($sectionname) : new ArrayObject;
          }
  
          $result = static::getDefaultConfig($loops);
          $result->merge($config);
          $result->offsetSet('loops', $loops);
          return $result;
      }
code: public static function getConfig(Loops $loops = NULL, ArrayObject $config = NULL) {
          if(!$loops) {
              $loops = Loops::getCurrentLoops();
          }
  
          if(!$config) {
              $parts = explode("\\", get_called_class());
              if(count($parts) > 2 && array_slice($parts, 0, 2) == [ "Loops", "Service" ]) {
                  $parts = array_slice($parts, 2);
              }
  
              $sectionname = Misc::underscore(implode("\\", $parts));
  
              $config = $loops->getService('config');
              $config = $config->offsetExists($sectionname) ? $config->offsetGet($sectionname) : new ArrayObject;
          }
  
          $result = static::getDefaultConfig($loops);
          $result->merge($config);
          $result->offsetSet('loops', $loops);
          return $result;
      }
code_tokens: public static function getConfig ( Loops $ loops = NULL , ArrayObject $ config = NULL ) { if ( ! $ loops ) { $ loops = Loops :: getCurrentLoops ( ) ; } if ( ! $ config ) { $ parts = explode ( "\\" , get_called_class ( ) ) ; if ( count ( $ parts ) > 2 && array_slice ( $ parts , 0 , 2 ) == [ "Loops" , "Service" ] ) { $ parts = array_slice ( $ parts , 2 ) ; } $ sectionname = Misc :: underscore ( implode ( "\\" , $ parts ) ) ; $ config = $ loops -> getService ( 'config' ) ; $ config = $ config -> offsetExists ( $ sectionname ) ? $ config -> offsetGet ( $ sectionname ) : new ArrayObject ; } $ result = static :: getDefaultConfig ( $ loops ) ; $ result -> merge ( $ config ) ; $ result -> offsetSet ( 'loops' , $ loops ) ; return $ result ; }
docstring: Returns the complete config of a service
  
  A Loops context will be included in the configuration.
  The config value will be generated by getting the default configuration of this class to which additional config values
  can be merged.
  If no additional values have been set, the config service of the Loops context will be looked for extra values. Here,
  the value at the key that is determined as follows will be used:
  1. Get the classname of this class without the "Loops\Service\" part. e.g. "SmartyRenderer" for class "Loops\Service\SmartyRenderer"
  2. Underscore the classname (see Misc::undercore). e.g. "smarty_renderer" for classname "SmartyRenderer"
  So in order to define extra configuration values for the service "Loops\Service\SmartyRenderer" these values must be accessable by
  key "smarty_renderer" in the config service.
  Example in case a config.ini file is used (which is true for most cases):
  <code>
  ...
  
  [smarty_renderer]
  disable_security = TRUE
  
  ...
  </code>
  
  @param Loops $loops The Loops context. It will be included in the configuration. Defaults to the current Loops context if not set.
  @param Loops\ArrayObject $config Additional config values that should be merged to the default config.
  @return Loops\ArrayObject The configuration which combines default values with additional values and the loops context
docstring_tokens: Returns the complete config of a service