merged branch gimler/cleamup_yaml (PR #7264)
This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes #7264). Commits ------- edda254 remove dead code in yaml component Discussion ---------- remove dead code in yaml component | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Cleanup unused code. --------------------------------------------------------------------------- by fabpot at 2013-03-06T16:27:57Z Can you explain why it is not needed anymore? --------------------------------------------------------------------------- by igorw at 2013-03-06T16:44:30Z `$subject` is no longer used anywhere. The `substr` is now done inline in the `preg_match` call. This code is effectively dead.
This commit is contained in:
commit
ae46cfb723
@ -235,11 +235,6 @@ class Inline
|
|||||||
*/
|
*/
|
||||||
private static function parseQuotedScalar($scalar, &$i)
|
private static function parseQuotedScalar($scalar, &$i)
|
||||||
{
|
{
|
||||||
// Only check the current item we're dealing with (for sequences)
|
|
||||||
$subject = substr($scalar, $i);
|
|
||||||
$items = preg_split('/[\'"]\s*(?:[,:]|[}\]]\s*,)/', $subject);
|
|
||||||
$subject = substr($subject, 0, strlen($items[0]) + 1);
|
|
||||||
|
|
||||||
if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) {
|
if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) {
|
||||||
throw new ParseException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i)));
|
throw new ParseException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i)));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user