Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
aa0e1782
Commit
aa0e1782
authored
Feb 17, 2012
by
gdd
Browse files
Added docblock for castValue
parent
9c700a65
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/lib/Drupal/Core/Config/DrupalConfig.php
View file @
aa0e1782
...
@@ -126,6 +126,22 @@ public function set($key, $value) {
...
@@ -126,6 +126,22 @@ public function set($key, $value) {
return
$this
;
return
$this
;
}
}
/**
* Casts a saved value to a string.
*
* The configuration system only saves strings or arrays. Any scalar
* non-string value is cast to a string. The one exception is boolean FALSE
* which would normally become '' when cast to a string, but is manually
* cast to '0' here for convenience and consistency.
*
* Any non-scalar value that is not an array (aka objects) gets cast
* to an array.
*
* @param $value
* A value being saved into the configuration system.
* @param $value
* The value cast to a string or array.
*/
public
function
castValue
(
$value
)
{
public
function
castValue
(
$value
)
{
if
(
is_scalar
(
$value
))
{
if
(
is_scalar
(
$value
))
{
// Handle special case of FALSE, which should be '0' instead of ''.
// Handle special case of FALSE, which should be '0' instead of ''.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment