mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
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:
parent
0a0a09920b
commit
42f9f8e2c3
2 changed files with 9 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue