for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* This file is part of the Thunder micro CLI framework.
* (c) Jérémy Marodon <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace RxThunder\Core\Model;
final class DataModel
{
private string $type;
private Payload $payload;
private MetadataBag $metadata;
/**
* @param array<int|string, bool|int|float|string> $metadata
public function __construct(
string $type,
?Payload $payload = null,
?array $metadata = []
) {
$this->type = $type;
$this->payload = $payload ?? new Payload();
$this->metadata = new MetadataBag($metadata);
}
public function getType(): string
return $this->type;
public function getPayload(): Payload
return $this->payload;
public function getMetadata(): MetadataBag
return $this->metadata;