From 42f9f8e2c3329d44d64ea4fb9e93946fe79b7f79 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 12 Nov 2011 20:44:32 -0500 Subject: [PATCH] Fixing strict errors. While this is a minor API change, its required to make CakePHP pass E_STRICT in testing. --- lib/Cake/View/Helper/JsBaseEngineHelper.php | 7 +++++-- lib/Cake/View/Helper/JsHelper.php | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/Cake/View/Helper/JsBaseEngineHelper.php b/lib/Cake/View/Helper/JsBaseEngineHelper.php index adbf46ee2ee..34062f07e37 100644 --- a/lib/Cake/View/Helper/JsBaseEngineHelper.php +++ b/lib/Cake/View/Helper/JsBaseEngineHelper.php @@ -154,7 +154,10 @@ public function object($data = array(), $options = array()) { * @param boolean $quoteString If false, leaves string values unquoted * @return string a JavaScript-safe/JSON representation of $val */ - public function value($val, $quoteString = true) { + public function value($val = array(), $quoteString = null, $key = 'value') { + if ($quoteString === null) { + $quoteString = true; + } switch (true) { case (is_array($val) || is_object($val)): $val = $this->object($val); @@ -598,4 +601,4 @@ protected function _toQuerystring($parameters) { } return $out; } -} \ No newline at end of file +} diff --git a/lib/Cake/View/Helper/JsHelper.php b/lib/Cake/View/Helper/JsHelper.php index f6c6eeffb52..a46251b7702 100644 --- a/lib/Cake/View/Helper/JsHelper.php +++ b/lib/Cake/View/Helper/JsHelper.php @@ -160,7 +160,10 @@ public function __call($method, $params) { * @param boolean $quoteString If false, leaves string values unquoted * @return string a JavaScript-safe/JSON representation of $val **/ - public function value($val, $quoteString = true) { + public function value($val = array(), $quoteString = null, $key = 'value') { + if ($quoteString === null) { + $quoteString = true; + } return $this->{$this->_engineName}->value($val, $quoteString); }