Receive line from connection

@param   string  $delimiter  Line delimiter

@throws  SocketClientException   On socket communication error
@return  string                  String from socket connection
974687
public function recvLine($delimiter = "\n") {
        $str = '';
        while (!$this->stream_eof()) {
            $char = $this->recvChr();
            $str .= $char;
            if ($char === false) { return $str; }
            if (strpos($str, $delimiter) !== false) { return $str; }
        }
        return $str;
    }
1086857
public function parse( $data = null, $type = null, $delimiter = null ) {

		if ( ! empty( $data ) ) {
			$this->input = $data;
		}

		if ( ! empty( $type ) && in_array( $type, $this->types, true ) ) {
			$this->type = $type;
		}

		if ( !empty( $delimiter ) )
			$this->delimiter = $delimiter;

		if ( method_exists( $this, "parse_{$this->type}" ) ) {
			return call_user_func( array( $this, 'parse_' . $this->type ) );
		}

		return $this->parsed;
	}
388639
public function readResponse($multiline = false)
    {
        $result = @fgets($this->_socket);
        if (!is_string($result)) {
            /**
             * @see Zend_Mail_Protocol_Exception
             */
            // require_once 'Zend/Mail/Protocol/Exception.php';
            throw new Zend_Mail_Protocol_Exception('read failed - connection closed?');
        }

        $result = trim($result);
        if (strpos($result, ' ')) {
            list($status, $message) = explode(' ', $result, 2);
        } else {
            $status = $result;
            $message = '';
        }

        if ($status != '+OK') {
            /**
             * @see Zend_Mail_Protocol_Exception
             */
            // require_once 'Zend/Mail/Protocol/Exception.php';
            throw new Zend_Mail_Protocol_Exception('last request failed');
        }

        if ($multiline) {
            $message = '';
            $line = fgets($this->_socket);
            while ($line && rtrim($line, "\r\n") != '.') {
                if ($line[0] == '.') {
                    $line = substr($line, 1);
                }
                $message .= $line;
                $line = fgets($this->_socket);
            };
        }

        return $message;
    }
159168
public function removeWordDelimiter ($delimiter)
    {
        if (empty($delimiter)) {
            throw new Exception('Word delimiter cannot be null.');
        }
        if (is_array($delimiter)) {
            foreach ($delimiter as $delim) {
                $this->removeWordDelimiter($delim);
            }
        } else {
            if (! in_array($delimiter, $this->getWordDelimiters())) {
                throw new Exception("Word delimiter '$delimiter' is not in delimiters array.");
            }
            $newArray = array();
            foreach ($this->_wordDelimiters as $delim) {
                if ($delim != $delimiter) {
                    $newArray[] = $delim;
                }
                $this->_wordDelimiters = $newArray;
            }
        }
        return $this;
    }
381945
public function _setTokenEnd($delimiter)
    {
        if (
            !($delimiter instanceof Stringable) &&
            !is_string($delimiter) &&
            !is_null($delimiter)
        ) {
            throw $this->_createInvalidArgumentException($this->__('Invalid token start delimiter'), null, null, $delimiter);
        }

        $this->tokenEnd = $delimiter;
    }
752850
public static function split(string $string, string $delimiter = ','): array
    {
        return preg_split('/\s*' . preg_quote($delimiter, '/') . '\s*/', $string, -1, PREG_SPLIT_NO_EMPTY);
    }
655904
public function getNestedName(
        string $delimiter = ".",
        string $name = ""
    ): string
    {
        $keys = array_filter([$this->name, $name], "strlen");
        $parent = $this;
        while ($parent = $parent->getParent()) {
            $name = $parent->getName();
            if ($name) {
                array_unshift($keys, $parent->getName());
            }
        }
        return implode($delimiter, $keys);
    }
776750
protected function _setTokenEnd($delimiter)
    {
        if (!is_null($delimiter)) {
            $delimiter = $this->_normalizeTokenDelimiter($delimiter);
        }

        $this->tokenEnd = $delimiter;
    }
149200
protected function sendToClient($line)
    {
        $bytes = 0;
        $len   = strlen($line);
        if ($len) {
            while(true) {
                $sent = socket_write($this->client, $line, $len);
                if (false === $sent) {
                    throw new Exceptions\HttpStatusError(
                        "Internal server error.",
                        500
                    );
                }

                $bytes += $sent;
                if ($sent < $len) {
                    $line = substr($line, $sent);
                    $len -= $sent;
                } else {
                    break;
                }
            }
        }

        return $bytes;
    }
185419
private static function delimitString(string $string, string $delimiter): string
    {
        $output = [];

        if (preg_match('/\A[a-z0-9]+\z/ui', $string) && strtoupper($string) !== $string) {
            $parts = self::explodeOnCaps($string);
        } else {
            $parts = self::explodeOnDelims($string);
        }

        foreach ($parts as $part) {
            $output[] = $part.$delimiter;
        }

        return rtrim(implode('', $output), $delimiter);
    }
675330
public function getName(array $keys = [], string $delimiter = "."): string
    {
        if (empty($keys)) {
            return $this->name;
        }

        $keys[] = $this->name;
        return implode($delimiter, $keys);
    }
229155
public function setDelimiter(string $delimiter): self
    {
        if ($delimiter === $this->delimiter) {
            return $this;
        }

        if (1 === strlen($delimiter)) {
            $this->delimiter = $delimiter;
            $this->resetProperties();

            return $this;
        }

        throw new Exception(sprintf('%s() expects delimiter to be a single character %s given', __METHOD__, $delimiter));
    }
1107602
protected function getLine()
    {
        $line = fgets($this->socket);

        if ($line === false) {
            $this->disconnect();
        }

        $this->debug('Receiving: '.$line);

        return $line;
    }
497439
protected static function stringToArray(
        string $delimiter,
        int $limit = PHP_INT_MAX,
        RuleInterface $next = null
    ): RuleInterface {
        return $next === null ?
            new StringToArray($delimiter, $limit) : new AndOperator(new StringToArray($delimiter, $limit), $next);
    }
552967
protected function _stringNode($delimiter = '', $heredoc = false)
    {
        $this->_codeNode();
        $token = $this->_stream->current(true);
        if (!$delimiter) {
            $this->_states['body'] = $token[1];
        } elseif ($delimiter === '"') {
            $this->_states['body'] = $token[1] . $this->_stream->next('"');
        } else {
            $this->_states['body'] = $token[1] . $this->_stream->nextSequence($delimiter);
        }
        if ($heredoc) {
            $this->_states['body'] .= $this->_stream->next([';']);
        }

        $node = new NodeDef($this->_states['body'], 'string');
        $this->_contextualize($node);
        return $node;
    }
122124
public static function snake($str, $delimiter = '_')
    {
        $str = preg_replace('/\s+/u', $delimiter, $str);

        $str = static::lower(preg_replace_callback('/([A-Z])/u', function ($math) use ($delimiter) {
            return $delimiter.static::lower($math[1]);
        }, $str));

        return trim(preg_replace('/'.$delimiter.'{2,}/', $delimiter, $str), $delimiter);
    }
37921
public static function snake($str, $delimiter = '_')
    {
        $str = preg_replace('/([A-Z ])/', ' $1', $str);
        $str = preg_replace('/\s+/', $delimiter, trim($str));
        $str = strtolower($str);

        return $str;
    }