Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixing strict errors.
While this is a minor API change, its required to
make CakePHP pass E_STRICT in testing.
  • Loading branch information
markstory committed Nov 13, 2011
1 parent 0a0a099 commit 42f9f8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/Cake/View/Helper/JsBaseEngineHelper.php
Expand Up @@ -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);
Expand Down Expand Up @@ -598,4 +601,4 @@ protected function _toQuerystring($parameters) {
}
return $out;
}
}
}
5 changes: 4 additions & 1 deletion lib/Cake/View/Helper/JsHelper.php
Expand Up @@ -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);
}

Expand Down

0 comments on commit 42f9f8e

Please sign in to comment.