@param array $callbackData

@return \Kerox\Messenger\Model\Callback\GamePlay
551687
public static function create(array $callbackData): self
    {
        return new self(
            $callbackData['game_id'],
            $callbackData['player_id'],
            $callbackData['context_type'],
            $callbackData['context_id'],
            $callbackData['score'],
            $callbackData['payload']
        );
    }
955989
public function update($callbackId, CallbackBuilder $input, array $queryParams = [])
    {
        $response = $this->api->callbacks()->update($callbackId, $input->toArray(), $queryParams);

        return new CallbackResponse($response);
    }
1350875
private function restoreResponse(array $cacheData)
    {
        $body = null;

        if (isset($cacheData['headers']['x-content-digest'][0])) {
            $item = $this->cache->getItem($cacheData['headers']['x-content-digest'][0]);
            if ($item->isHit()) {
                $body = $item->get();
            }
        }

        return new Response(
            $body,
            $cacheData['status'],
            $cacheData['headers']
        );
    }
1047139
protected function getCreationEvent($formData)
    {
        $contentCreateEvent = new ContentCreateEvent();

        $contentCreateEvent
            ->setLocale($formData['locale'])
            ->setDefaultFolder($formData['default_folder'])
            ->setTitle($formData['title'])
            ->setVisible($formData['visible'])
        ;

        return $contentCreateEvent;
    }
214469
public static function createFromResponse($responseData)
    {
        $sendCode = new self(null, null);
        $sendCode->setRawResponseData($responseData)
            ->processResponse();

        if ($sendCode['status'] !== 0 && $sendCode['status'] !== '0') {
            throw new Exception($sendCode['err_msg']);
        }

        return $sendCode;
    }
835816
public static function setPlatformAuthData(EntityAuthData $entityAuthData)
	{
		if(self::$_instance === NULL)
			throw new SonicRuntimeException('Sonic instance not initialized');
		
		self::$_instance->platformAuthData = $entityAuthData;
		
		return self::$_instance;
	}
666609
public static function create(array $callbackData): self
    {
        $requestedUserInfo = RequestedUserInfo::create($callbackData['requested_user_info']);

        return new self($callbackData['payload'], $requestedUserInfo, $callbackData['amount']);
    }
1071185
private function sendEventData(array $eventData)
    {
        $socket = $this->prepareSocket();
        $datagram = json_encode($eventData);
        $result = socket_write($socket, $datagram, strlen($datagram));
        if ($result === false) {
            $this->prepareSocket(true);
        }
        return $result;
    }
625986
public static function create(array $data): Player
    {
        $player = new Player();
        parent::fill($data, $player);
        if (is_array($player->clan)) {
            $player->clan = Clan::create($player->clan);
        }
        if (is_array($player->league)) {
            $player->league = League::create($player->league);
        }
        return $player;
    }
1212331
public function run(&$actionData)
    {
        foreach ($actionData->entities as $className => $ids) {
            if (class_exists($className)) {
                $ids = (array) $ids;
                $models = [];
                $mapping = ArrayHelper::getValue($this->entitiesMapping, $className, $className);

                $modelLoadSettings = ArrayHelper::merge(
                    [
                        'useCache' => true,
                        'cacheLifetime' => 86400,
                        'throwException' => false,
                        'useIdentityMap' => true,
                    ],
                    ArrayHelper::getValue($this->entitiesLoadSettings, $className, [])
                );

                foreach ($ids as $id) {
                    /** @var TagDependencyTrait $className */
                    $models[$id] = $className::loadModel(
                        $id,
                        false,
                        $modelLoadSettings['useCache'],
                        $modelLoadSettings['cacheLifetime'],
                        $modelLoadSettings['throwException'],
                        $modelLoadSettings['useIdentityMap']
                    );
                }
                if ($this->convertOneModelToArray === false && count($models) === 1) {
                    $models = reset($models);
                }
                if ($this->nullOnEmptyArray === true && count($models) === 0) {
                    $models = null;
                }
                /** @var string $className */
                // replace with models
                switch ($this->fill) {
                    case static::FILL_ENTITIES_ADD:
                        $actionData->entities[$mapping] = $models;
                        break;
                    case static::FILL_ENTITIES_REPLACE:
                        unset($actionData->entities[$className]);
                        $actionData->entities[$mapping] = $models;
                        break;
                    case static::FILL_RESULT:
                    default:
                        $actionData->result[$mapping] = $models;
                        break;
                }
            }
        }
    }
1244887
public function news($newsData=array())
	{

		$count = count($newsData);

		$msg = array(
			'ToUserName' => $this->getRevFrom(),
			'FromUserName'=>$this->getRevTo(),
			'MsgType'=>self::MSGTYPE_NEWS,
			'CreateTime'=>time(),
			'ArticleCount'=>$count,
			'Articles'=>$newsData,

		);
		$this->Message($msg);
		return $this;
	}
785225
public function addModel(array $modelData)
    {
        // swagger only has locations for requests, so we can safely default to our response serializer.
        $model = $this->createModel($modelData, $this->responseType);
        $modelData = $model->toArray();
        if ($modelData['type'] === 'array' && isset($modelData['name'])) {
            unset($modelData['name']);
        }
        $this->debug('+ adding model %s', $model->getName());
        $this->models[$model->getName()] = $modelData;

        return $model;
    }
1095004
private function captureInput(array $eventData)
    {
        $inputData = [
            'text' => FallbackCommand::CMD,
        ];

        if (empty($eventData['replyToken'])) {
            throw new \InvalidArgumentException("Require `replyToken` to run.");
        }

        if (empty($eventData['source']['userId'])) {
            throw new \InvalidArgumentException("Require `userId` to run.");
        }

        $inputData['replyToken'] = $eventData['replyToken'];
        $inputData['userId'] = $eventData['source']['userId'];
        $type = strtolower(@$eventData['type']);

        switch ($type) {
            case Constants::REVEIVE_TYPE_FOLLOW:
                $inputData['text'] = ':follow';
                break;

            case Constants::REVEIVE_TYPE_MESSAGE:
                $inputData['text'] = $this->captureReceiveMessageText($eventData);
                break;

            default:
                throw new \RuntimeException("Unsupported event type `$type`.");
        }

        return new Input($inputData);
    }
1263794
static public function fromArrayCallback(array $data, callable $callback) {
		$ret = new FormOptions();
		foreach ( $data as $item ){
			list($value, $text) = $callback($item);
			$ret->add($value, $text);
		}
		return $ret;
	}
453335
public function setCallbackObjectStatus($callbackObjectStatus = FALSE)
    {
        $this->callbackObjectStatus = $callbackObjectStatus;
        $this->debug->debug(__FUNCTION__, 'setCallbackObjectStatus: ' . json_encode($this->callbackObjectStatus));
    }
958785
public function errorAction(array $errorData)
    {
        $this->pool->reset();

        // Get the main part.
        $main = $this->pool->render->renderFatalMain(
            $errorData[static::TRACE_TYPE],
            $errorData[static::TRACE_ERROR_STRING],
            $errorData[static::TRACE_ERROR_FILE],
            $errorData[static::TRACE_ERROR_LINE]
        );

        // Get the backtrace.
        $backtrace = $this->pool
            ->createClass('Brainworxx\\Krexx\\Analyse\\Routing\\Process\\ProcessBacktrace')
            ->process($errorData[static::TRACE_BACKTRACE]);

        if ($this->pool->emergencyHandler->checkEmergencyBreak() === true) {
            return $this;
        }

        // Detect the encoding on the start-chunk-string of the analysis
        // for a complete encoding picture.
        $this->pool->chunks->detectEncoding($main . $backtrace);

        // Get the header, footer and messages
        $footer = $this->outputFooter(array());
        $header = $this->pool->render->renderFatalHeader($this->outputCssAndJs());
        $messages = $this->pool->messages->outputMessages();

        // Add the caller as metadata to the chunks class. It will be saved as
        // additional info, in case we are logging to a file.
        $this->pool->chunks->addMetadata(
            array(
                static::TRACE_FILE => $errorData[static::TRACE_ERROR_FILE],
                static::TRACE_LINE => $errorData[static::TRACE_ERROR_LINE] + 1,
                static::TRACE_VARNAME => ' Fatal Error',
            )
        );

        $this->outputService->addChunkString($header)
            ->addChunkString($messages)
            ->addChunkString($main)
            ->addChunkString($backtrace)
            ->addChunkString($footer)
            ->finalize();

        return $this;
    }
807410
public function setRequestData($requestData)
    {
        if (is_array($requestData)) {
            $this->requestData = http_build_query($requestData);
        } else {
            $this->requestData = $requestData;
        }
        return $this;
    }