Get key value pair string

@param  string $key   The parameter key
@param  string $value The parameter value
@return string
966330
protected function getKeyValuePair($key, $value)
    {
        if (strpos($value, '"') !== false) {
            return ' ' . $key . '=\'' . $value . '\'';
        }
        return ' ' . $key . '="' . $value . '"';
    }
736235
protected function getContent($key, $value)
    {
        $headerPath = $this->getHeaderPath($key);
        $header = !is_null($headerPath) && file_exists($headerPath)
            ? file_get_contents($headerPath)
            : $this->getDefaultHeader($key);
            
        return $header.PHP_EOL."return ".common_Utils::toHumanReadablePhpString($value).";".PHP_EOL;
    }
609948
protected function formatParam($key, $value)
    {
        $supportedFixes = [
            'lt'     => '<',
            'gt'     => '>',
            'lte'    => '<=',
            'gte'    => '>=',
            'lk'     => 'LIKE',
            'not-lk' => 'NOT LIKE',
            'in'     => 'IN',
            'not-in' => 'NOT IN',
            'not'    => '!=',
        ];

        $prefixes = implode('|', $supportedFixes);
        $suffixes = implode('|', array_keys($supportedFixes));

        $matches = [];

        // Matches every parameter with an optional prefix and/or postfix
        // e.g. not-title-lk, title-lk, not-title, title
        $regex = '/^(?:('.$prefixes.')-)?(.*?)(?:-('.$suffixes.')|$)/';

        preg_match($regex, $key, $matches);

        if (! isset($matches[3])) {
            if (Str::lower(trim($value)) == 'null') {
                $comparator = 'NULL';
            } else {
                $comparator = '=';
            }
        } else {
            if (Str::lower(trim($value)) == 'null') {
                $comparator = 'NOT NULL';
            } else {
                $comparator = $supportedFixes[$matches[3]];
            }
        }

        $column = isset($matches[2]) ? $matches[2] : null;

        return compact('comparator', 'column', 'matches');
    }
432836
public function pairs($key, $value)
	{
		$this->select([$key, $value]);

		$query = $this->compiler->select();

		return $this->connection->pairs($query['sql'], $query['params']);
	}
1228201
public function search(string $key, string $value)
    {
        return $this->getRepository()->findBy(['key' => $key, 'value' => $value]);
    }
217174
protected function getLabel($key, $value)
    {
        
        if ($this->labelsCache === null) { 
            $this->prepareCacheLabels();
        }
        
        return $this->labelsCache[$key]($value);
    }
424245
static public function urlencode($value)
    {
        if (is_string($value)) {
            return urlencode($value);
        } elseif (is_array($value)) {
            foreach ($value as $k => $v) {
                $value[$k] = static::urlencode($v);
            }
        }
        return $value;
    }
1073411
private static function generateQueryString($key, $value)
    {
        // Query string separators ("=", "&") within the key or value need to be encoded
        // (while preventing double-encoding) before setting the query string. All other
        // chars that need percent-encoding will be encoded by withQuery().
        $queryString = strtr($key, self::$replaceQuery);

        if ($value !== null) {
            $queryString .= '=' . strtr($value, self::$replaceQuery);
        }

        return $queryString;
    }
492292
private function parsePhpValue($key, $value, array &$result)
    {
        $node =& $result;
        $keyBuffer = '';

        for ($i = 0, $t = strlen($key); $i < $t; $i++) {
            switch ($key[$i]) {
                case '[':
                    if ($keyBuffer) {
                        $this->prepareNode($node, $keyBuffer);
                        $node =& $node[$keyBuffer];
                        $keyBuffer = '';
                    }
                    break;
                case ']':
                    $k = $this->cleanKey($node, $keyBuffer);
                    $this->prepareNode($node, $k);
                    $node =& $node[$k];
                    $keyBuffer = '';
                    break;
                default:
                    $keyBuffer .= $key[$i];
                    break;
            }
        }

        if (isset($node)) {
            $this->duplicates = true;
            $node[] = $value;
        } else {
            $node = $value;
        }
    }
1276334
private function convert($request, $key, $value)
	{
		if (is_array($value) || is_object($value))
		{
			return $this->traverse($request, $value);
		}

		if (!in_array($key, $this->keys, true))
		{
			return $value;
		}

		if (substr($value, 0, 4) == 'http')
		{
			return $value;
		}

		return rtrim(str_replace('/api', '', $request->root()), '/') . '/' . ltrim($value, '/');
	}
806783
public static function getSetting($key, $value = null)
    {
        $data = ini_get($key);
        if ($data === false) {
            throw new \InvalidArgumentException(sprintf("Invalid PHP setting '%s'", $key));
        }

        if ($value === null) {
            return $data;
        } else {
            ini_set($key, $value);
        }
    }
325297
public function get(string $value)
    {
        if (!$this->has($value)) {
            throw new \InvalidArgumentException(\sprintf(
                'Value %s is not a valid key, expecting one of %s',
                $value,
                \implode(', ', \array_keys($this->values))
            ));
        }

        return $this->values[$value];
    }
257662
protected function getOrSetParam($key, $value = null)
    {
        if (is_null($value)) {
            return $this->params[$key];
        }

        $this->params[$key] = $value;

        return $this;
    }
354513
protected function getSetterValue($key, $value)
    {
        if (empty($value)) {
            return;
        }

        switch ($key) {
            case 'redirectTarget':
                $value = $this->documentManager->find($value);
                break;
            case 'permissions':
                $value = json_decode($value, true);
                break;
            case 'navigationContexts':
                $value = json_decode($value);
                break;
        }

        return $value;
    }
1041853
public static function get($key, $value = null)
    {
        if (array_has(static::$register, $key)) {
            return static::$register[$key];
        } else {
            static::set($key, $value);

            return $value;
        }
    }
1105675
protected function useKey(string $key, $value = null) : string
    {
        if ($value !== null && $this->isValidType($value) === false) {
            throw new \InvalidArgumentException($this->messageInvalidValue);
        }

        return (($value === null) ? $key : $value->getName());
    }
1242601
public function setParam($key, $value)
        {
            $key = (string) $key;

            if ((null === $value) && isset($this->_params[$key])) {
                unset($this->_params[$key]);
            } elseif (null !== $value) {
                $this->_params[$key] = $value;
            }

            return $this;
        }