for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace TechDeCo\ElasticApmAgent\Message;
use JsonSerializable;
use TechDeCo\ElasticApmAgent\Serialization;
final class User implements JsonSerializable
{
/**
* @var string|int|null
*/
private $id;
* @var string|null
private $email;
* @var string
private $username;
* @param string|int $id
public function withId($id): self
$me = clone $this;
$me->id = $id;
return $me;
}
public function withEmail(string $email): self
$me->email = $email;
public function withUsername(string $username): self
$me->username = $username;
* @return mixed[]
public function jsonSerialize(): array
return Serialization::filterUnset([
'id' => $this->id,
'email' => $this->email,
'username' => $this->username,
]);