Skip to content

Commit 46a4b38

Browse files
authored
Remove unused $nullAsTilde property
1 parent 53a8b41 commit 46a4b38

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Symfony/Component/Yaml/Inline.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class Inline
3333
private static $objectSupport = false;
3434
private static $objectForMap = false;
3535
private static $constantSupport = false;
36-
private static $nullAsTilde = false;
3736

3837
/**
3938
* @param int $flags
@@ -46,7 +45,6 @@ public static function initialize($flags, $parsedLineNumber = null, $parsedFilen
4645
self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags);
4746
self::$objectForMap = (bool) (Yaml::PARSE_OBJECT_FOR_MAP & $flags);
4847
self::$constantSupport = (bool) (Yaml::PARSE_CONSTANT & $flags);
49-
self::$nullAsTilde = (bool) (Yaml::DUMP_NULL_AS_TILDE & $flags);
5048
self::$parsedFilename = $parsedFilename;
5149

5250
if (null !== $parsedLineNumber) {
@@ -131,7 +129,7 @@ public static function dump($value, int $flags = 0): string
131129
throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value)));
132130
}
133131

134-
return self::dumpNull();
132+
return self::dumpNull($flags);
135133
case $value instanceof \DateTimeInterface:
136134
return $value->format('c');
137135
case \is_object($value):
@@ -157,11 +155,11 @@ public static function dump($value, int $flags = 0): string
157155
throw new DumpException('Object support when dumping a YAML file has been disabled.');
158156
}
159157

160-
return self::dumpNull();
158+
return self::dumpNull($flags);
161159
case \is_array($value):
162160
return self::dumpArray($value, $flags);
163161
case null === $value:
164-
return self::dumpNull();
162+
return self::dumpNull($flags);
165163
case true === $value:
166164
return 'true';
167165
case false === $value:
@@ -258,9 +256,9 @@ private static function dumpArray(array $value, int $flags): string
258256
return sprintf('{ %s }', implode(', ', $output));
259257
}
260258

261-
private static function dumpNull(): string
259+
private static function dumpNull(int $flags): string
262260
{
263-
if (self::$nullAsTilde) {
261+
if (Yaml::DUMP_NULL_AS_TILDE & $flags) {
264262
return '~';
265263
}
266264

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy