original_string: protected static function _encodeYaml($indent, $data)
      {
          reset($data);
          $result = "";
          $numeric = is_numeric(key($data));
  
          foreach($data as $key => $value) {
              if(is_array($value)) {
                  $encoded = "\n".self::_encodeYaml($indent+1, $value);
              } else {
                  $encoded = (string)$value."\n";
              }
              $result .= str_repeat("  ", $indent).($numeric?"- ":"$key: ").$encoded;
          }
          return $result;
      }
code: protected static function _encodeYaml($indent, $data)
      {
          reset($data);
          $result = "";
          $numeric = is_numeric(key($data));
  
          foreach($data as $key => $value) {
              if(is_array($value)) {
                  $encoded = "\n".self::_encodeYaml($indent+1, $value);
              } else {
                  $encoded = (string)$value."\n";
              }
              $result .= str_repeat("  ", $indent).($numeric?"- ":"$key: ").$encoded;
          }
          return $result;
      }
code_tokens: protected static function _encodeYaml ( $ indent , $ data ) { reset ( $ data ) ; $ result = "" ; $ numeric = is_numeric ( key ( $ data ) ) ; foreach ( $ data as $ key => $ value ) { if ( is_array ( $ value ) ) { $ encoded = "\n" . self :: _encodeYaml ( $ indent + 1 , $ value ) ; } else { $ encoded = ( string ) $ value . "\n" ; } $ result .= str_repeat ( "  " , $ indent ) . ( $ numeric ? "- " : "$key: " ) . $ encoded ; } return $ result ; }
docstring: Service function for encoding YAML
  
  @param int $indent Current indent level
  @param array $data Data to encode
  @return string
docstring_tokens: Service function for encoding YAML