protected function toBoolean($value)
    {
        if ($value === 1 || $value === 'true') {
            return true;
        }
        if (is_null($value) || $value === 0 || $value === 'false') {
            return false;
        }
        if ($this->getTypeCheck()->isArray($value) && count($value) === 1) {
            return $this->toBoolean(reset($value));
        }

        return $value;
    }
protected function toBoolean($value)
    {
        if ($value === 1 || $value === 'true') {
            return true;
        }
        if (is_null($value) || $value === 0 || $value === 'false') {
            return false;
        }
        if ($this->getTypeCheck()->isArray($value) && count($value) === 1) {
            return $this->toBoolean(reset($value));
        }

        return $value;
    }
protected function toBoolean ( $ value ) { if ( $ value === 1 || $ value === 'true' ) { return true ; } if ( is_null ( $ value ) || $ value === 0 || $ value === 'false' ) { return false ; } if ( $ this -> getTypeCheck ( ) -> isArray ( $ value ) && count ( $ value ) === 1 ) { return $ this -> toBoolean ( reset ( $ value ) ) ; } return $ value ; }
Converts a value to boolean. For example, "true" becomes true.

@param $value The value to convert to boolean

@return bool|mixed
Converts a value to boolean . For example true becomes true .