Wrap a value in keyword identifiers.

@param  string  $value
@return string
337862
public function wrap($value, $prefixAlias = false)
    {
        // We will only wrap the value unless it has parentheses
        // in it which is the case where we're matching a node by id, or an *
        // and last whether this is a pre-formatted key.
        if (preg_match('/[(|)]/', $value) || $value == '*' || strpos($value, '.') !== false) return $value;

        // In the case where the developer specifies the properties and not returning
        // everything, we need to check whether the primaryKey is meant to be returned
        // since Neo4j's way of evaluating returned properties for the Node id is
        // different: id(n) instead of n.id

        if ($value == 'id')
        {
            return 'id(' . $this->query->modelAsNode() . ')';
        }
        return $this->query->modelAsNode() . '.' . $value;
    }
636271
private function stringEscaped($value)
    {
        $value = $this->string($value);
        $value = str_replace(self::$strReplaceFrom, self::$strReplaceTo, $value);

        return $value;
    }
414032
protected function coerceString($value)
    {
        if ($value[0] === Type::T_STRING) {
            return $value;
        }

        return [Type::T_STRING, '', [$this->compileValue($value)]];
    }
1270771
protected function compileString($value)
    {
        $result = '';

        // Block raw php
        if (strpos($value, '@php') !== false) {
            $value = $this->storePhpBlocks($value);
        }

        foreach (token_get_all($value) as $token) {
            $result .= is_array($token) ? $this->parseToken($token) : $token;
        }

        return $result;
    }
887209
public static function studlyCaps($value)
    {
        $key = $value;

        if (isset(static::$studlyCache[$key])) {
            return static::$studlyCache[$key];
        }

        static::$studlyCache[$key] = str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $value)));

        return static::$studlyCache[$key];
    }
353889
protected static function stringify($value): string
    {
        if (is_object($value)) {
            return 'Object(' . get_class($value) . ')';

        } elseif (is_array($value)) {
            $strings = [];
            foreach ($value as $k => $v) {
                $strings[] = sprintf('%s => %s', $k, self::stringify($v));
            }
            return 'Array(' . implode(', ', $strings) . ')';

        } elseif (is_resource($value)) {
            return 'Resource (' . get_resource_type($value) . ')';

        } elseif (is_null($value)) {
            return 'null';

        } elseif (is_bool($value)) {
            return $value ? 'true' : 'false';
        }

        return "'" . (string)$value . "'";
    }
1017254
public function bind($value)
    {
        //Argument 1 must be an array, string or number
        Argument::i()->test(1, 'array', 'string', 'numeric', 'null');
        
        if (is_array($value)) {
            foreach ($value as $i => $item) {
                $value[$i] = $this->bind($item);
            }
            
            return '('.implode(",", $value).')';
        } else if (is_int($value) || ctype_digit($value)) {
            return $value;
        }
        
        $name = ':bind'.count($this->binds).'bind';
        $this->binds[$name] = $value;
        return $name;
    }
621884
protected function mapInfoForValue($value) {
		if ($this->processor->startsWith($value, '\'') && $this->processor->endsWith($value, '\'')) {
			return ['around' => '\''];
		}

		if ($this->processor->startsWith($value, '"') && $this->processor->endsWith($value, '"')) {
			return ['around' => '"'];
		}
	}
452809
protected function getQuoteValue($value): string
    {
        $key = uniqid();
        $this->builder->setParameter($key, $value);

        return ":{$key}";
    }
345162
protected function serializeValue($value)
    {
        $serialized = var_export($value, true);
        if ($serialized === 'NULL') {
            $serialized = strtolower($serialized);
        }

        return $serialized;
    }
890953
protected static function _encodeValue($value)
    {
        $string = '';

        switch (gettype($value))
        {
            case 'integer':
            case 'double':
                $string = $value;
                break;

            case 'boolean':
                $string = $value ? 'true' : 'false';
                break;

            case 'string':
                // Sanitize any CRLF characters..
                $string = '"' . str_replace(array("\r\n", "\n"), '\\n', $value) . '"';
                break;
        }

        return $string;
    }
121054
protected function wrapJsonSelector($value)
	{
		$path = explode('->', $value);

		$field = $this->wrapValue(array_shift($path));

		return $field.'->'.'"$.'.implode('.', $path).'"';
	}
791017
protected function encode($value)
    {
        if (is_array($value)) {
            return array_map([$this, 'encode'], $value);
        } else {
            return str_replace(['+', '%7E'], [' ', '~'], rawurlencode($value));
        }
    }
180954
private function decorateValue($value) : string
    {
        $ret = 'null';
        switch(gettype($value)){
            case 'string':
                $ret = $this->decorateStringValue($value);
                break;
            case 'integer':
            case 'double':
                $ret = $value;
                break;
            case 'boolean':
                $ret = $value ? 'true' : 'false';
                break;
            case 'array':
                $ret = $this->decorateArrayValue($value);
                break;
        }
        return $ret;
    }
1076148
protected function getValueAsIni($value)
	{
		$string = '';

		switch (\gettype($value))
		{
			case 'integer':
			case 'double':
				$string = $value;

				break;

			case 'boolean':
				$string = $value ? 'true' : 'false';

				break;

			case 'string':
				// Sanitize any CRLF characters..
				$string = '"' . str_replace(array("\r\n", "\n"), '\\n', $value) . '"';

				break;
		}

		return $string;
	}
1365254
public function getAndSet(string $value): string
    {
        return $this->handle->getSet($this->name, $value);
    }
648722
protected function packValue($value): string
    {
        if ($value instanceof DeclarationInterface) {
            //No indentation here
            return $value->render();
        }

        if (is_null($value)) {
            return "null";
        }

        if (is_bool($value)) {
            return ($value ? "true" : "false");
        }

        if (is_object($value) && method_exists($value, '__set_state')) {
            return var_export($value, true);
        }

        if (!is_string($value) && !is_numeric($value)) {
            throw new SerializeException("Unable to pack non scalar value");
        }

        if (is_string($value) && class_exists($value)) {
            $reflection = new \ReflectionClass($value);
            if ($value === $reflection->getName()) {
                return '\\' . $reflection->getName() . '::class';
            }
        }

        return var_export($value, true);
    }