@param bool $close

@return string
15197
protected function getIndent($close = FALSE) {
    $indent_per_level = str_repeat(' ', $this->config['indent']);
    return str_repeat($indent_per_level, $this->indentLevel - ($close ? 1 : 0));
  }
1279130
public function getExpression(bool $clean = false) : string
    {
        return $clean ?
            str_replace(self::EXP_TOKEN, '', $this->expression) : // clean up expression from placeholder tokens.
            $this->expression;
    }
527025
public function method( $method = false ) : string
	{
		if( true === $method ){
			return (isset( $this->server['request_method'] ) ?? $this->server['request_method']);
		} elseif( !$this->method ){
			if( isset( $_server['http_x_method_override'] ) ){
				$this->method = strtoupper( $this->server['http_x_method_override'] );
			} else{
				$this->method = strtoupper( isset( $this->server['request_method'] ) ? $this->server['request_method'] : null );
			}
		}
		return $this->method;
	}
1108352
public function asString($absolute = false)
  {
    $url = '/';
    if ($absolute) {
      $puny = new Punycode();
      $url = $this->getScheme() . '://' . $puny->encode($this->getHost()) . '/';
    }

    if ($a = $this->getArguments()) {
      foreach ($this->getArguments() as $str) {
        $url .= urlencode($str) . '/';
      }
    }

    $url .= $this->buildParams();

    if ($fn = $this->getFileName(true)) {
      $url .= urlencode($fn);
    }

    return $url;
  }
1304223
protected function string(&$out)
    {
        $s = $this->seek();

        if ($this->literal('"', false)) {
            $delim = '"';
        } elseif ($this->literal("'", false)) {
            $delim = "'";
        } else {
            return false;
        }

        $content = [];
        $oldWhite = $this->eatWhiteDefault;
        $this->eatWhiteDefault = false;
        $hasInterpolation = false;

        while ($this->matchString($m, $delim)) {
            if ($m[1] !== '') {
                $content[] = $m[1];
            }

            if ($m[2] === '#{') {
                $this->count -= strlen($m[2]);

                if ($this->interpolation($inter, false)) {
                    $content[] = $inter;
                    $hasInterpolation = true;
                } else {
                    $this->count += strlen($m[2]);
                    $content[] = '#{'; // ignore it
                }
            } elseif ($m[2] === '\\') {
                if ($this->literal('"', false)) {
                    $content[] = $m[2] . '"';
                } elseif ($this->literal("'", false)) {
                    $content[] = $m[2] . "'";
                } else {
                    $content[] = $m[2];
                }
            } else {
                $this->count -= strlen($delim);
                break; // delim
            }
        }

        $this->eatWhiteDefault = $oldWhite;

        if ($this->literal($delim)) {
            if ($hasInterpolation) {
                $delim = '"';

                foreach ($content as &$string) {
                    if ($string === "\\'") {
                        $string = "'";
                    } elseif ($string === '\\"') {
                        $string = '"';
                    }
                }
            }

            $out = [Type::T_STRING, $delim, $content];

            return true;
        }

        $this->seek($s);

        return false;
    }
720302
public function getResult(bool $wrap)
    {
        $rc = $this->factory->getProxy($this->val, $this->signature, $this->exception, $wrap);

        $factory = $this->factory;
        $this->factory = $this->client->simpleFactory;
        if ($rc instanceof \Soluble\Japha\Bridge\Driver\Pjb62\Exception\JavaException) {
            $factory->checkResult($rc);
        }

        return $rc;
    }
94442
public static function toString($data, bool $dump = true): string
    {
        if (is_callable($data)) {
            return static::toString($data());
        }

        if (is_stringable($data)) {
            return (string) $data;
        }

        if (is_array($data)) {
            $data = $dump ? Arr::dump($data) : 'Array()';
        }

        if (is_object($data)) {
            $data = $dump ? Arr::dump($data) : sprintf('[Object %s]', get_class($data));
        }

        return (string) $data;
    }
188048
public function toString(bool $compact = false): string
    {
        if ($compact) {
            return \bin2hex($this->value);
        }
        
        return \vsprintf('%s%s-%s-%s-%s-%s%s%s', \str_split(\bin2hex($this->value), 4));
    }
480770
public static function current($full = false)
    {
        if (empty(static::$_current)) {
            return '';
        } elseif ($full === false) {
            return static::$_current;
        }

        return static::$_modes[static::$_current];
    }
917738
public function build(bool $complete = true): string
    {
        $sql = [];
        $sql = $this->getSelectSql($sql);
        $sql = $this->getColumnsSql($sql);
        $sql = $this->getFromSql($sql);
        $sql = $this->getJoinSql($sql);
        $sql = $this->condition->getWhereSql($sql);
        $sql = $this->getGroupBySql($sql);
        $sql = $this->condition->getHavingSql($sql);
        $sql = $this->getOrderBySql($sql);
        $sql = $this->getLimitSql($sql);
        $sql = $this->getUnionSql($sql);
        $result = trim(implode(' ', $sql));
        $result = $this->getAliasSql($result);
        if ($complete) {
            $result = trim($result) . ';';
        }

        return $result;
    }
1338494
protected function getBoolFromStringBool($value)
    {
        if (!($value == 'true' || $value == 'false')) {
            $this->throwException(sprintf('Expected "true" or "false" but got %s', $value));
        }

        return $value === 'true' ? true : false;
    }
1143205
private function buildUrl(string $resource, ?bool $secure): string
    {
        $secure = isset($secure) ? (bool) $secure : $this->secure;

        $endpoint = $secure ? self::HTTPS_ENDPOINT : self::HTTP_ENDPOINT;

        return sprintf('%s/%s', $endpoint, $resource);
    }
904720
public function toString(bool $idn = false)
    {
        $o = "";
        if (!empty($this->scheme))
            $o .= $this->scheme . "://";
        
        if (!empty($this->username) && !empty($this->password))
            $o .= $this->username . ':' . $this->password . '@';

        // Check for IDN
        $host = $this->host;
        if ($idn && preg_match('/[^\x20-\x7f]/', $host))
            $host = \idn_to_ascii($host);
        $o .= $host;

        if (!empty($this->port))
        {
            if (!(
                ($this->scheme === "http"  && $this->port === 80) ||
                ($this->scheme === "https" && $this->port === 443) || 
                ($this->scheme === "ftp"   && $this->port === 21)
            ))
                $o .= ":" . $this->port;
        }

        $o .= $this->path;
        $query = $this->getQuery();

        if (!empty($query))
            $o .= '?' . $query;

        if (!empty($this->fragment))
            $o .= '#' . $this->fragment;

        return $o;
    }
654539
function $true(params) {
    if (typeof params === 'boolean') {
        return params;
    }
    if (typeof params === 'number') {
        return params === 1;
    }
    if (typeof params === 'string') {
        params = params.trim();

        return params.toLowerCase() === 'true' || params === '1';
    }

    return false;
}
856971
public function debug(bool $oneLine = false): string
    {
        $query = $this->getSQL();

        foreach ($this->getBindings()->getBindings() as $parameter => $bind) {
            if ($parameter[0] == ':') {
                $parameter = substr($parameter, 1);
            }

            $value = $bind->getValue();

            $type = gettype($value);
            switch ($type) {
                case 'string':
                    $query = str_replace(":{$parameter}", ("'" . addslashes((string) $value) . "'"), $query);
                    break;

                case 'integer':
                case 'float':
                case 'double':
                    $query = str_replace(":{$parameter}", $value, $query);
                    break;

                case 'NULL':
                    $query = str_replace(":{$parameter}", 'NULL', $query);
                    break;

                case 'boolean':
                    $true = (bool)$value;
                    $query = str_replace(":{$parameter}", $true ? 'true' : 'false', $query);
                    break;

                case 'object':
                case 'array':
                case 'resource':
                case 'unknown type':
	                throw new QueryException("Unsupported type ({$type}) was passed as parameter ({$parameter}) to SQL statement");
                    break;

                default:
	                throw new \Koldy\Exception('Unknown data type (' . $type . ') was passed to SQL statement');
                    break;
            }
        }

        if ($oneLine) {
            $query = str_replace("\t", '', $query);
            $query = str_replace("\n", ' ', $query);
            $query = str_replace('  ', ' ', $query);
        }

        return $query;
    }
1138263
public static function prev(Bool $isPath = true) : String
    {
        if( ! isset($_SERVER['HTTP_REFERER']) )
        {
            return false;
        }
        
        $str = str_replace(URL::site(), '', $_SERVER['HTTP_REFERER']);

        if( $isPath === true )
        {
            return $str;
        }
        else
        {
            return Strings\Split::divide($str, '/', -1);
        }
    }
238277
protected function convertStringToBool($bool)
    {
        $bool = strtoupper($bool);

        if ($bool === strtoupper($this->schema->false())) {
            return false;
        } elseif ($bool === strtoupper($this->schema->true())) {
            return true;
        } else {
            return;
        }
    }