original_string: public function get($key, $defaultValue = null)
      {
          $keys = explode('.', $key);
          $config = $this->_arr;
  
          foreach ($keys as $value) {
              if (is_array($config)) {
                  if (array_key_exists($value, $config)) {
                      $config = $config[$value];
                  } else {
                      return $defaultValue;
                  }
              } else {
                  return $defaultValue;
              }
          }
  
          return $config;
      }
code: public function get($key, $defaultValue = null)
      {
          $keys = explode('.', $key);
          $config = $this->_arr;
  
          foreach ($keys as $value) {
              if (is_array($config)) {
                  if (array_key_exists($value, $config)) {
                      $config = $config[$value];
                  } else {
                      return $defaultValue;
                  }
              } else {
                  return $defaultValue;
              }
          }
  
          return $config;
      }
code_tokens: public function get ( $ key , $ defaultValue = null ) { $ keys = explode ( '.' , $ key ) ; $ config = $ this -> _arr ; foreach ( $ keys as $ value ) { if ( is_array ( $ config ) ) { if ( array_key_exists ( $ value , $ config ) ) { $ config = $ config [ $ value ] ; } else { return $ defaultValue ; } } else { return $ defaultValue ; } } return $ config ; }
docstring: Gets config value based on key.
  
  To access a sub-array you can use a dot separated key.
  For example, given this configuration array :
  
  array(
  'basePath' => 'somepath',
  'params' => array(
  'somekey' => 'value of key'
  )
  );
  
  To access the value of 'somekey', you can call the method like this :
  
  echo $config->get('params.somekey');
  
  The code above will print 'value of key' which is the value of
  config 'somekey' in the 'params' array.
  
  @param string $key           Dot-separated string of key
  @param mixed $defaultValue   Default value returned when **$key** is not found.
  
  @return mixed Value of config
docstring_tokens: Gets config value based on key .