private function getReceivedData($key = null)
    {
        $received = self::$received;

        if ($key !== null) {
            if (is_array($received) && isset($received[$key])) {
                return $received[$key];
            }

            if (isset($received->$key)) {
                return $received->$key;
            }

            return null;
        }

        return is_object($received) ? (array)$received : $received;
    }