protected static function parseQuotedScalar($scalar, &$i)
  {
    if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) {
      throw new InvalidArgumentException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i)));
    }

    $output = substr($match[0], 1, strlen($match[0]) - 2);

    if ('"' == $scalar[$i]) {
      // evaluate the string
      $output = str_replace(array('\\"', '\\n', '\\r'), array('"', "\n", "\r"), $output);
    } else {
      // unescape '
      $output = str_replace('\'\'', '\'', $output);
    }

    $i += strlen($match[0]);

    return $output;
  }
protected static function parseQuotedScalar($scalar, &$i)
  {
    if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) {
      throw new InvalidArgumentException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i)));
    }

    $output = substr($match[0], 1, strlen($match[0]) - 2);

    if ('"' == $scalar[$i]) {
      // evaluate the string
      $output = str_replace(array('\\"', '\\n', '\\r'), array('"', "\n", "\r"), $output);
    } else {
      // unescape '
      $output = str_replace('\'\'', '\'', $output);
    }

    $i += strlen($match[0]);

    return $output;
  }
protected static function parseQuotedScalar ( $ scalar , & $ i ) { if ( ! preg_match ( '/' . self :: REGEX_QUOTED_STRING . '/Au' , substr ( $ scalar , $ i ) , $ match ) ) { throw new InvalidArgumentException ( sprintf ( 'Malformed inline YAML string (%s).' , substr ( $ scalar , $ i ) ) ) ; } $ output = substr ( $ match [ 0 ] , 1 , strlen ( $ match [ 0 ] ) - 2 ) ; if ( '"' == $ scalar [ $ i ] ) { // evaluate the string $ output = str_replace ( array ( '\\"' , '\\n' , '\\r' ) , array ( '"' , "\n" , "\r" ) , $ output ) ; } else { // unescape ' $ output = str_replace ( '\'\'' , '\'' , $ output ) ; } $ i += strlen ( $ match [ 0 ] ) ; return $ output ; }
Parses a quoted scalar to YAML.

@param string  $scalar
@param integer $i

@return string A YAML string
Parses a quoted scalar to YAML .