Skip to content

Commit bb5d49c

Browse files
committed
minor symfony#52334 [Yaml]  Inline::parse(null) not allowed (GromNaN)
This PR was merged into the 6.4 branch. Discussion ---------- [Yaml]  `Inline::parse(null)` not allowed | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | Fix symfony#52326 | License | MIT It's only called with string values in the Yaml component. This class is internal. It allows to change the arg type. The arg type was documented as `string`. symfony@7b1715b#diff-1d97fcfb29e99f0200c3952e9a1a11c4b9f825c0f5ad4d4515b9b1805f8c988eR47 Commits ------- 834e0ab Passing null to Inline::parse is not allowed
2 parents 31bd20a + 834e0ab commit bb5d49c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Yaml/Inline.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static function initialize(int $flags, int $parsedLineNumber = null, stri
5555
*
5656
* @throws ParseException
5757
*/
58-
public static function parse(string $value = null, int $flags = 0, array &$references = []): mixed
58+
public static function parse(string $value, int $flags = 0, array &$references = []): mixed
5959
{
6060
if (null === $value) {
6161
return '';

src/Symfony/Component/Yaml/Tests/InlineTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected function setUp(): void
2929
/**
3030
* @dataProvider getTestsForParse
3131
*/
32-
public function testParse($yaml, $value, $flags = 0)
32+
public function testParse(string $yaml, $value, $flags = 0)
3333
{
3434
$this->assertSame($value, Inline::parse($yaml, $flags), sprintf('::parse() converts an inline YAML to a PHP structure (%s)', $yaml));
3535
}

0 commit comments

Comments
 (0)