PhpOrient\Protocols\Binary\Serialization\CSV::eatKey PHP Method

eatKey() protected static method

Consume a field key, which may or may not be quoted.
protected static eatKey ( string $input ) : array
$input string The input to consume
return array The collected string and any remaining content.
    protected static function eatKey($input)
    {
        $length = strlen($input);
        $collected = '';
        if (isset($input[0]) && $input[0] === '"') {
            $result = self::eatString(substr($input, 1));
            return [$result[0], substr($result[1], 1)];
        }
        for ($i = 0; $i < $length; $i++) {
            $c = $input[$i];
            if ($c === ':') {
                break;
            } else {
                $collected .= $c;
            }
        }
        return [$collected, substr($input, $i + 1)];
    }