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

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Willbanks committed Oct 20, 2013
2 parents 89e1265 + 5bc0027 commit 87df75a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Expr.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
* 'integer' => 9,
* 'string' => 'test string',
* 'function' => Zend\Json\Expr(
* 'function() { window.alert("javascript function encoded by Zend\Json\Json") }'
* 'function () { window.alert("javascript function encoded by Zend\Json\Json") }'
* ),
* );
*
* Zend\Json\Json::encode($foo, false, array('enableJsonExprFinder' => true));
* // it will returns json encoded string:
* // {"integer":9,"string":"test string","function":function() {window.alert("javascript function encoded by Zend\Json\Json")}}
* // {"integer":9,"string":"test string","function":function () {window.alert("javascript function encoded by Zend\Json\Json")}}
* </code>
*/
class Expr
Expand Down
8 changes: 4 additions & 4 deletions test/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,12 @@ public function testEncodingMultipleNestedSwitchingSameNameKeysWithDifferentJSON
{
$data = array(
0 => array(
"alpha" => new Json\Expr("function() {}"),
"alpha" => new Json\Expr("function () {}"),
"beta" => "gamma",
),
1 => array(
"alpha" => "gamma",
"beta" => new Json\Expr("function() {}"),
"beta" => new Json\Expr("function () {}"),
),
2 => array(
"alpha" => "gamma",
Expand All @@ -554,7 +554,7 @@ public function testEncodingMultipleNestedSwitchingSameNameKeysWithDifferentJSON
$result = Json\Json::encode($data, false, array('enableJsonExprFinder' => true));

$this->assertEquals(
'[{"alpha":function() {},"beta":"gamma"},{"alpha":"gamma","beta":function() {}},{"alpha":"gamma","beta":"gamma"}]',
'[{"alpha":function () {},"beta":"gamma"},{"alpha":"gamma","beta":function () {}},{"alpha":"gamma","beta":"gamma"}]',
$result
);
}
Expand Down Expand Up @@ -594,7 +594,7 @@ public function testDisabledJSONExprFinder()

$data = array(
0 => array(
"alpha" => new Json\Expr("function() {}"),
"alpha" => new Json\Expr("function () {}"),
"beta" => "gamma",
),
);
Expand Down

0 comments on commit 87df75a

Please sign in to comment.