Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: symfony/yaml
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.3.5
Choose a base ref
...
head repository: symfony/yaml
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.3.6
Choose a head ref
  • 6 commits
  • 5 files changed
  • 3 contributors

Commits on Oct 15, 2019

  1. Copy the full SHA
    471ca8e View commit details

Commits on Oct 18, 2019

  1. Merge branch '3.4' into 4.3

    * 3.4:
      [Dotenv] allow LF in single-quoted strings
      [Yaml] Throw exception for tagged invalid inline elements
    nicolas-grekas committed Oct 18, 2019
    Copy the full SHA
    0b17448 View commit details

Commits on Oct 24, 2019

  1. Copy the full SHA
    5dca0bd View commit details
  2. Copy the full SHA
    dab657d View commit details

Commits on Oct 28, 2019

  1. Merge branch '3.4' into 4.3

    * 3.4:
      #30432 fix an error message
      fix paths to detect code owners
      [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
      Remove unused local variables in tests
      Make sure to collect child forms created on *_SET_DATA events
      do not render errors for checkboxes twice
    nicolas-grekas committed Oct 28, 2019
    Copy the full SHA
    7fbd58a View commit details

Commits on Oct 30, 2019

  1. Copy the full SHA
    324cf4b View commit details
Showing with 12 additions and 15 deletions.
  1. +4 −4 Inline.php
  2. +0 −9 Parser.php
  3. +1 −1 Tests/Command/LintCommandTest.php
  4. +6 −0 Tests/InlineTest.php
  5. +1 −1 Tests/ParserTest.php
8 changes: 4 additions & 4 deletions Inline.php
Original file line number Diff line number Diff line change
@@ -94,15 +94,15 @@ public static function parse(string $value = null, int $flags = 0, array $refere
$result = self::parseScalar($value, $flags, null, $i, null === $tag, $references);
}

if (null !== $tag && '' !== $tag) {
return new TaggedValue($tag, $result);
}

// some comments are allowed at the end
if (preg_replace('/\s+#.*$/A', '', substr($value, $i))) {
throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
}

if (null !== $tag && '' !== $tag) {
return new TaggedValue($tag, $result);
}

return $result;
} finally {
if (isset($mbEncoding)) {
9 changes: 0 additions & 9 deletions Parser.php
Original file line number Diff line number Diff line change
@@ -85,7 +85,6 @@ public function parse(string $value, int $flags = 0)
$this->refs = [];

$mbEncoding = null;
$data = null;

if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) {
$mbEncoding = mb_internal_encoding();
@@ -108,14 +107,6 @@ public function parse(string $value, int $flags = 0)
return $data;
}

/**
* @internal
*/
public function getLastLineNumberBeforeDeprecation(): int
{
return $this->getRealCurrentLineNb();
}

private function doParse(string $value, int $flags)
{
$this->currentLineNb = -1;
2 changes: 1 addition & 1 deletion Tests/Command/LintCommandTest.php
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@ public function testLintFileNotReadable()
$filename = $this->createFile('');
unlink($filename);

$ret = $tester->execute(['filename' => $filename], ['decorated' => false]);
$tester->execute(['filename' => $filename], ['decorated' => false]);
}

/**
6 changes: 6 additions & 0 deletions Tests/InlineTest.php
Original file line number Diff line number Diff line change
@@ -167,6 +167,12 @@ public function testParseInvalidSequenceShouldThrowException()
Inline::parse('{ foo: bar } bar');
}

public function testParseInvalidTaggedSequenceShouldThrowException()
{
$this->expectException('Symfony\Component\Yaml\Exception\ParseException');
Inline::parse('!foo { bar: baz } qux', Yaml::PARSE_CUSTOM_TAGS);
}

public function testParseScalarWithCorrectlyQuotedStringShouldReturnString()
{
$value = "'don''t do somthin'' like that'";
2 changes: 1 addition & 1 deletion Tests/ParserTest.php
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ public function testTabsInYaml()

foreach ($yamls as $yaml) {
try {
$content = $this->parser->parse($yaml);
$this->parser->parse($yaml);

$this->fail('YAML files must not contain tabs');
} catch (\Exception $e) {