protected function normalize(array $data)
    {
        $body = json_encode($data);

        if ($this->length($body) > static::MAX_SIZE) {
            unset($data['events'][0]['metaData']);
        }

        $body = json_encode($data);

        if ($this->length($body) > static::MAX_SIZE) {
            throw new RuntimeException('Payload too large');
        }

        return $data;
    }
protected function normalize(array $data)
    {
        $body = json_encode($data);

        if ($this->length($body) > static::MAX_SIZE) {
            unset($data['events'][0]['metaData']);
        }

        $body = json_encode($data);

        if ($this->length($body) > static::MAX_SIZE) {
            throw new RuntimeException('Payload too large');
        }

        return $data;
    }
protected function normalize ( array $ data ) { $ body = json_encode ( $ data ) ; if ( $ this -> length ( $ body ) > static :: MAX_SIZE ) { unset ( $ data [ 'events' ] [ 0 ] [ 'metaData' ] ) ; } $ body = json_encode ( $ data ) ; if ( $ this -> length ( $ body ) > static :: MAX_SIZE ) { throw new RuntimeException ( 'Payload too large' ) ; } return $ data ; }
Normalize the given data to ensure it's the correct size.

@param array $data the data to normalize

@throws \RuntimeException

@return array
Normalize the given data to ensure it s the correct size .