Skip to content

Commit bb1e076

Browse files
committed
minor symfony#21191 [Yaml] Remove unused argument (GuilhemN)
This PR was merged into the 3.3-dev branch. Discussion ---------- [Yaml] Remove unused argument | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#... <!--highly recommended for new features--> This PR removes an unused argument of `Inline::parseScalar()`. I based it on master as that's not really a bug fix but the lowest applicable branch is 3.0 (the method was not internal in 2.x). Commits ------- 1a14a1f [Yaml] Remove an unused argument
2 parents 5f4ba31 + 1a14a1f commit bb1e076

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/Symfony/Component/Yaml/Inline.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static function parse($value, $flags = 0, $references = array())
104104
++$i;
105105
break;
106106
default:
107-
$result = self::parseScalar($value, $flags, null, array('"', "'"), $i, true, $references);
107+
$result = self::parseScalar($value, $flags, null, $i, true, $references);
108108
}
109109

110110
// some comments are allowed at the end
@@ -276,7 +276,6 @@ private static function dumpArray($value, $flags)
276276
* @param string $scalar
277277
* @param int $flags
278278
* @param string $delimiters
279-
* @param array $stringDelimiters
280279
* @param int &$i
281280
* @param bool $evaluate
282281
* @param array $references
@@ -287,9 +286,9 @@ private static function dumpArray($value, $flags)
287286
*
288287
* @internal
289288
*/
290-
public static function parseScalar($scalar, $flags = 0, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true, $references = array())
289+
public static function parseScalar($scalar, $flags = 0, $delimiters = null, &$i = 0, $evaluate = true, $references = array())
291290
{
292-
if (in_array($scalar[$i], $stringDelimiters)) {
291+
if (in_array($scalar[$i], array('"', "'"))) {
293292
// quoted scalar
294293
$output = self::parseQuotedScalar($scalar, $i);
295294

@@ -399,7 +398,7 @@ private static function parseSequence($sequence, $flags, &$i = 0, $references =
399398
break;
400399
default:
401400
$isQuoted = in_array($sequence[$i], array('"', "'"));
402-
$value = self::parseScalar($sequence, $flags, array(',', ']'), array('"', "'"), $i, true, $references);
401+
$value = self::parseScalar($sequence, $flags, array(',', ']'), $i, true, $references);
403402

404403
// the value can be an array if a reference has been resolved to an array var
405404
if (is_string($value) && !$isQuoted && false !== strpos($value, ': ')) {
@@ -457,7 +456,7 @@ private static function parseMapping($mapping, $flags, &$i = 0, $references = ar
457456
}
458457

459458
// key
460-
$key = self::parseScalar($mapping, $flags, array(':', ' '), array('"', "'"), $i, false);
459+
$key = self::parseScalar($mapping, $flags, array(':', ' '), $i, false);
461460

462461
if (false === $i = strpos($mapping, ':', $i)) {
463462
break;
@@ -502,7 +501,7 @@ private static function parseMapping($mapping, $flags, &$i = 0, $references = ar
502501
case ' ':
503502
break;
504503
default:
505-
$value = self::parseScalar($mapping, $flags, array(',', '}'), array('"', "'"), $i, true, $references);
504+
$value = self::parseScalar($mapping, $flags, array(',', '}'), $i, true, $references);
506505
// Spec: Keys MUST be unique; first one wins.
507506
// Parser cannot abort this mapping earlier, since lines
508507
// are processed sequentially.

0 commit comments

Comments
 (0)