@param array $payload

@return \Kerox\Messenger\Event\RequestThreadControlEvent
760619
public static function create(array $payload): self
    {
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];
        $requestThreadControl = RequestThreadControl::create($payload['request_thread_control']);

        return new static($senderId, $recipientId, $timestamp, $requestThreadControl);
    }
78404
private function sendTransmission(array $payload)
    {
        try {
            /** @noinspection PhpUndefinedVariableInspection */
            $promise = $this->sparkpost->transmissions->post($payload);

            if ($promise instanceof SparkPostResponse) {
                $response = $promise;
            } else {
                $response = $promise->wait();
            }
        } catch (AnyException $exception) {
            throw $this->createAndDispatchTransportException(
                'Failed to send transmission to SparkPost',
                $exception
            );
        }

        if (!isset($response->getBody()['results'])) {
            throw $this->createAndDispatchTransportException(
                'Failed to send transmission to SparkPost',
                new Exception(json_encode($response->getBody()))
            );
        }

        return $response;
    }
181320
public function event($name, $payload = null) {
		$this->log->log("EVENT: $name",  Net_XMPP_XMPPHP_Log::LEVEL_DEBUG);
		foreach($this->eventhandlers as $handler) {
			if($name == $handler[0]) {
				if($handler[2] === null) {
					$handler[2] = $this;
				}
				$handler[2]->$handler[1]($payload);
			}
		}
		foreach($this->until as $key => $until) {
			if(is_array($until)) {
				if(in_array($name, $until)) {
					$this->until_payload[$key][] = array($name, $payload);
					if(!isset($this->until_count[$key])) {
						$this->until_count[$key] = 0;
					}
					$this->until_count[$key] += 1;
					#$this->until[$key] = false;
				}
			}
		}
	}
462422
public static function create(array $payload): self
    {
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];
        $passThreadControl = PassThreadControl::create($payload['pass_thread_control']);

        return new static($senderId, $recipientId, $timestamp, $passThreadControl);
    }
1171980
public static function unserializeMessagePayload($payload)
    {
        $message = json_decode($payload, true);
        if (json_last_error() === JSON_ERROR_NONE) {
            return $message;
        }

        return $payload;
    }
1136456
public function process($payload) {
        $result = $this->convertToObject($payload, true);

        return $this->processPayload($result);
    }
1018549
private function createRequest($method, array $payload)
    {
        $request = new Request(
            'POST',
            self::API_BASE_URL . $method,
            ['Content-Type' => 'application/x-www-form-urlencoded'],
            http_build_query($payload)
        );

        return $request;
    }
1097485
public function pushRaw($payload, $queue = null, array $options = [])
    {
        $this->getConnection()->rPush($this->getQueue($queue), $payload);

        return Arr::get(json_decode($payload, true), 'id');
    }
481521
protected function addRequestInformation(&$payload)
    {
        if ($this->container->bound('request')) {
            $payload = array_merge($payload, [
                'ip_address' => $this->ipAddress(),
                'user_agent' => $this->userAgent(),
            ]);
        }

        return $this;
    }
1348584
private function performCurlSession($payload)
    {
        $perCurlConnection = curl_init();
        curl_setopt($perCurlConnection, CURLOPT_URL, $this->url);
        curl_setopt($perCurlConnection, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($perCurlConnection, CURLOPT_TIMEOUT, 10);
        curl_setopt($perCurlConnection, CURLOPT_POSTFIELDS, $payload);

        $result = curl_exec($perCurlConnection);

        return $result;
    }
921627
public static function createMessageReadEvent(array $payload)
    {
        $read = Read::create($payload['read']);
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];

        return new MessageReadEvent($senderId, $recipientId, $timestamp, $read);
    }
133932
public static function create(array $payload): self
    {
        $senderId = isset($payload['sender']) ? $payload['sender']['id'] : '';
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];
        $policyEnforcement = PolicyEnforcement::create($payload['policy-enforcement']);

        return new static($senderId, $recipientId, $timestamp, $policyEnforcement);
    }
901983
protected function validateSynchronizerToken(array $payload=null)
    {
        if ($this->configuration->get('csrf_protection')) {
            if (!is_null($payload) && isset($payload[$this->configuration->get('csrf_parameter')])) {

                $this->logger->debug('validate synchronizer token', array('name' => $this->getName(), 'token' => $payload[$this->configuration->get('csrf_parameter')]));
                $token = $payload[$this->configuration->get('csrf_parameter')];

                if ($this->synchronizerToken->validate($this->getName(), $token)) {
                    $this->logger->debug('valid synchronizer token given', array('name' => $this->getName(), 'token' => $payload[$this->configuration->get('csrf_parameter')]));
                    return true;
                } else {
                    $this->logger->debug('invalid synchronizer token given', array('name' => $this->getName(), 'token' => $payload[$this->configuration->get('csrf_parameter')]));
                }
            } else {
                $this->logger->debug('no valid synchronizer token given', array('name' => $this->getName()));
            }
            return false;
        } else {
            $this->logger->debug('skip synchronizer token validation', array('name' => $this->getName()));
        }
        return true;
    }
311609
public function encode(array $payload)
    {
        try {
            $this->jws->setPayload($payload)->sign($this->secret);

            return $this->jws->getTokenString();
        } catch (Exception $e) {
            throw new JWTException('Could not create token: '.$e->getMessage());
        }
    }
438009
public static function create(array $payload): self
    {
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $delivery = Delivery::create($payload['delivery']);

        return new static($senderId, $recipientId, $delivery);
    }
731020
private function createContext(array $payload)
    {
        $canonical_payload = [];

        foreach ($payload as $k => $v) {
            $k = strtolower($k);
            $v = strtolower($v);

            $canonical_payload[$k] = sprintf('%s=%s', $k, $v);
        }

        ksort($canonical_payload);
        $signed_headers_string = implode(';', array_keys($canonical_payload));
        $canonical_context     = implode("\n", $canonical_payload) . "\n\n" . $signed_headers_string;

        $this->logger->debug(__FUNCTION__, [
            'payload' => $payload,
            'canonical_payload' => $canonical_payload,
            'signed_headers_string' => $signed_headers_string,
            'canonical_context' => $canonical_context,
        ]);

        /** @var string */
        return $canonical_context;
    }
419309
public static function create(array $payload): AbstractEvent
    {
        foreach (array_keys($payload) as $key) {
            if (\array_key_exists($key, self::EVENTS)) {
                $className = self::EVENTS[$key];
                if (isset($payload['message']['is_echo'])) {
                    $className = MessageEchoEvent::class;
                }

                return $className::create($payload);
            }
        }

        return RawEvent::create($payload);
    }