Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/5569-null' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Dec 7, 2013
2 parents 5371e74 + b079428 commit fba2506
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Writer/PhpArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ protected function processIndented(array $config, array $arraySyntax, &$indentLe
$arrayString .= ($value ? 'true' : 'false') . ",\n";
} elseif (is_string($value)) {
$arrayString .= "'" . addslashes($value) . "',\n";
} elseif ($value === null) {
$arrayString .= "null,\n";
} else {
$arrayString .= $value . ",\n";
}
Expand Down
2 changes: 2 additions & 0 deletions test/Writer/PhpArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function testRender()
'object' => (object) array('foo' => 'bar'),
'integer' => 123,
'boolean' => false,
'null' => null,
));

$configString = $this->writer->toString($config);
Expand All @@ -56,6 +57,7 @@ public function testRender()
$expected .= ")),\n";
$expected .= " 'integer' => 123,\n";
$expected .= " 'boolean' => false,\n";
$expected .= " 'null' => null,\n";
$expected .= ");\n";

$this->assertEquals($expected, $configString);
Expand Down

0 comments on commit fba2506

Please sign in to comment.