Fixing strict errors.

While this is a minor API change, its required to
make CakePHP pass E_STRICT in testing.
This commit is contained in:
mark_story 2011-11-12 20:44:32 -05:00
parent 0a0a09920b
commit 42f9f8e2c3
2 changed files with 9 additions and 3 deletions

View file

@ -154,7 +154,10 @@ abstract class JsBaseEngineHelper extends AppHelper {
* @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 @@ abstract class JsBaseEngineHelper extends AppHelper {
}
return $out;
}
}
}

View file

@ -160,7 +160,10 @@ class JsHelper extends AppHelper {
* @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);
}