Zephir\ClassProperty::getBooleanCode PHP Method

getBooleanCode() protected method

protected getBooleanCode ( $value ) : boolean | string
$value
return boolean | string
    protected function getBooleanCode($value)
    {
        if ($value && ($value == 'true' || $value === true)) {
            return '1';
        } else {
            if ($value == 'false' || $value === false) {
                return '0';
            }
        }
        return (bool) $value;
    }