Back to GetConfigurationCommand class

Method formatConfigValue

protected string
formatConfigValue
(mixed $value)
Formats the Configuration value
Parameters
  • mixed $value Value to be formatted
Returns
  • string
Since
  • -

Method formatConfigValue - Source code

/**
 * Formats the Configuration value
 *
 * @param   mixed  $value  Value to be formatted
 *
 * @return string
 *
 * @since version
 */
protected function formatConfigValue($value) : string
{
    if ($value === false) {
        return 'false';
    } elseif ($value === true) {
        return 'true';
    } elseif ($value === null) {
        return 'Not Set';
    } elseif (\is_array($value)) {
        return \json_encode($value);
    } elseif (\is_object($value)) {
        return \json_encode(\get_object_vars($value));
    } else {
        return $value;
    }
}