GELFMessagePublisher::prependChunkInformation PHP Method

prependChunkInformation() protected method

protected prependChunkInformation ( float $messageId, string $data, integer $sequence, integer $sequenceSize ) : string
$messageId float
$data string
$sequence integer
$sequenceSize integer
return string
    protected function prependChunkInformation($messageId, $data, $sequence, $sequenceSize)
    {
        if (!is_string($data) || $data === '') {
            throw new InvalidArgumentException('Data must be a string and not be empty.');
        }
        if (!is_integer($sequence) || !is_integer($sequenceSize)) {
            throw new InvalidArgumentException('Sequence number and size must be integer.');
        }
        if ($sequenceSize <= 0) {
            throw new InvalidArgumentException('Sequence size must be greater than 0.');
        }
        if ($sequence > $sequenceSize) {
            throw new InvalidArgumentException('Sequence size must be greater than sequence number.');
        }
        return pack('CC', 30, 15) . substr(md5($messageId, true), 0, 8) . pack('CC', $sequence, $sequenceSize) . $data;
    }