Skip to content

Commit 85b765b

Browse files
Merge branch '3.2'
* 3.2: Allow terminal dimensions to be set to 0 (unbounded) [Cache] Remove exception false-positive from FilesystemAdapterTrait fix risky tests fix risky tests [Yaml] release memory after parsing [HttpFoundation] Fix and test status codes according to IANA's data Add `use_strict_mode` in validOptions for session [Console] Inherit phpdoc from OutputFormatterInterface
2 parents 192c211 + 420de14 commit 85b765b

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

Parser.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ public function parse($value, $flags = 0)
111111
mb_internal_encoding($mbEncoding);
112112
}
113113

114+
$this->lines = array();
115+
$this->currentLine = '';
116+
$this->refs = array();
117+
$this->skippedLineNumbers = array();
118+
$this->locallySkippedLineNumbers = array();
119+
114120
if (null !== $e) {
115121
throw $e;
116122
}

Tests/InlineTest.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,24 +277,39 @@ public function testParseUnquotedAsteriskFollowedByAComment()
277277
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
278278
* @expectedExceptionMessage cannot start a plain scalar; you need to quote the scalar.
279279
*/
280-
public function testParseUnquotedScalarStartingWithReservedIndicator($indicator)
280+
public function testParseUnquotedScalarStartingWithReservedAtIndicator()
281281
{
282-
Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
282+
Inline::parse('{ foo: @foo }');
283283
}
284284

285-
public function getReservedIndicators()
285+
/**
286+
* @group legacy
287+
* @expectedDeprecation Not quoting the scalar "`foo " starting with "`" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
288+
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
289+
*/
290+
public function testParseUnquotedScalarStartingWithReservedBacktickIndicator()
291+
{
292+
Inline::parse('{ foo: `foo }');
293+
}
294+
295+
/**
296+
* @group legacy
297+
* @expectedDeprecation Not quoting the scalar "|foo " starting with "|" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
298+
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
299+
*/
300+
public function testParseUnquotedScalarStartingWithLiteralStyleIndicator()
286301
{
287-
return array(array('@'), array('`'));
302+
Inline::parse('{ foo: |foo }');
288303
}
289304

290305
/**
291306
* @dataProvider getScalarIndicators
292307
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
293308
* @expectedExceptionMessage cannot start a plain scalar; you need to quote the scalar.
294309
*/
295-
public function testParseUnquotedScalarStartingWithScalarIndicator($indicator)
310+
public function testParseUnquotedScalarStartingWithFoldedStyleIndicator()
296311
{
297-
Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
312+
Inline::parse('{ foo: >foo }');
298313
}
299314

300315
public function getScalarIndicators()

0 commit comments

Comments
 (0)