for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Jalle19\StatusManager\Message;
/**
* Base class for messages that can be sent between the server and the clients
*
* @package Jalle19\StatusManager
* @copyright Copyright © Sam Stenvall 2016-
* @license https://www.gnu.org/licenses/gpl.html The GNU General Public License v2.0
*/
abstract class AbstractMessage implements \JsonSerializable
{
const TYPE_STATUS_UPDATES = 'statusUpdates';
const TYPE_STATISTICS_POPULAR_CHANNELS = 'statisticsPopularChannels';
* @var string
private $_type;
* @var mixed
private $_payload;
* @param string $type
* @param mixed $payload
public function __construct($type, $payload)
$this->_type = $type;
$this->_payload = $payload;
}
* @return string
public function getType()
return $this->_type;
* @return mixed
public function getPayload()
return $this->_payload;
* @inheritdoc
public function jsonSerialize()
return [
'type' => $this->_type,
'payload' => $this->_payload,
];