for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Kerox\Messenger\Model\Callback;
class GamePlay
{
/**
* @var string
*/
protected $gameId;
protected $playerId;
protected $contextType;
protected $contextId;
* @var int
protected $score;
protected $payload;
* GamePlay constructor.
*
* @param string $gameId
* @param string $playerId
* @param string $contextType
* @param string $contextId
* @param int $score
* @param string $payload
public function __construct(
string $gameId,
string $playerId,
string $contextType,
string $contextId,
int $score,
string $payload
) {
$this->gameId = $gameId;
$this->playerId = $playerId;
$this->contextType = $contextType;
$this->contextId = $contextId;
$this->score = $score;
$this->payload = $payload;
}
* @return string
public function getGameId(): string
return $this->gameId;
public function getPlayerId(): string
return $this->playerId;
public function getContextType(): string
return $this->contextType;
public function getContextId(): string
return $this->contextId;
* @return int
public function getScore(): int
return $this->score;
public function getPayload(): string
return $this->payload;
* @param array $callbackData
* @return \Kerox\Messenger\Model\Callback\GamePlay
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']
);