Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ab8fca3

Browse files
committed
Fix @stof's comment
1 parent de9a6aa commit ab8fca3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/Serializer/Encoder/YamlEncoder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ class YamlEncoder implements EncoderInterface, DecoderInterface
2626

2727
private $dumper;
2828
private $parser;
29-
private $defaultContext;
29+
private $defaultContext = array('yaml_inline' => 0, 'yaml_indent' => 0, 'yaml_flags' => 0);
3030

31-
public function __construct(Dumper $dumper = null, Parser $parser = null, $defaultContext = array('yaml_inline' => 0, 'yaml_indent' => 0, 'yaml_flags' => 0))
31+
public function __construct(Dumper $dumper = null, Parser $parser = null, $defaultContext = [])
3232
{
3333
$this->dumper = $dumper ?: new Dumper();
3434
$this->parser = $parser ?: new Parser();
35-
$this->defaultContext = $defaultContext;
35+
$this->defaultContext = array_merge($this->defaultContext, $defaultContext);
3636
}
3737

3838
/**

0 commit comments

Comments
 (0)