protected function parseBool($value)
    {
        $value = strtolower($value);
        if (in_array($value, array('0', 'off', 'false'))) {
            return false;
        }
        if (in_array($value, array('1', 'on', 'true'))) {
            return true;
        }
        throw new \Exception('Invalid value "'.$value.'" for type "bool"');
    }
protected function parseBool($value)
    {
        $value = strtolower($value);
        if (in_array($value, array('0', 'off', 'false'))) {
            return false;
        }
        if (in_array($value, array('1', 'on', 'true'))) {
            return true;
        }
        throw new \Exception('Invalid value "'.$value.'" for type "bool"');
    }
protected function parseBool ( $ value ) { $ value = strtolower ( $ value ) ; if ( in_array ( $ value , array ( '0' , 'off' , 'false' ) ) ) { return false ; } if ( in_array ( $ value , array ( '1' , 'on' , 'true' ) ) ) { return true ; } throw new \ Exception ( 'Invalid value "' . $ value . '" for type "bool"' ) ; }
Parse a boolean out of some text.
"0", "off" or "false" can be used to represent
\c false while "1", "on" or "true" can used to
represent \c true.

\param string $value
Some text that's supposed to represent
a boolean value.

\retval bool
The value that was parsed.

\throw Exception
The given text did not contain
a boolean value.
Parse a boolean out of some text . 0 off or false can be used to represent \ c false while 1 on or true can used to represent \ c true .